Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya authored Jun 3, 2024
1 parent f21ec87 commit b4ff7ab
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/full/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oplayer/full",
"version": "0.0.1",
"version": "0.0.1-beta.0",
"description": "all loader in one",
"type": "module",
"main": "./dist/index.min.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/torrent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oplayer/torrent",
"version": "1.2.25-beta.1",
"version": "1.2.25-beta.2",
"description": "Torrent plugin for oplayer.",
"type": "module",
"main": "./dist/index.es.js",
Expand Down
30 changes: 16 additions & 14 deletions packages/torrent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TorrentPlugin implements PlayerPlugin {

if (!TorrentPlugin.library) {
TorrentPlugin.library =
(globalThis as any).Hls ||
(globalThis as any).WebTorrent ||
(library
? await loadSDK(library, 'WebTorrent')
: (await import('webtorrent/webtorrent.min.js')).default)
Expand All @@ -57,19 +57,21 @@ class TorrentPlugin implements PlayerPlugin {
torrent.files.forEach((file) => {
if (file.name.endsWith('.mp4')) {
medias.push(file)
} else if (file.name.endsWith('.srt')) {
// subtitlePromise.push(
// new Promise((resolve) => {
// file.getBlobURL((err, url) => {
// if (err) return
// resolve({
// name: file.name,
// src: url
// })
// })
// })
// )
} else if (file.name.startsWith('poster')) {
}
// else if (file.name.endsWith('.srt')) {
// subtitlePromise.push(
// new Promise((resolve) => {
// file.getBlobURL((err, url) => {
// if (err) return
// resolve({
// name: file.name,
// src: url
// })
// })
// })
// )
// }
else if (file.name.startsWith('poster')) {
file.getBlobURL((err, url) => {
if (err || !url) return
$video.poster = url
Expand Down

0 comments on commit b4ff7ab

Please sign in to comment.