diff --git a/README.md b/README.md index e276aba4..d3d0e587 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Player.make(document.getElementById('oplayer'), { ## Who use OPlayer? -- [UPV](https://月色真美.life) : free animes no ad +- [UPV](https://web.月色真美.life) : free animes no ad - [enime.moe](https://enime.moe) : An anime streaming site. Just hop in and watch with speed without VPN or ads ## Support diff --git a/examples/standalone/package.json b/examples/standalone/package.json index 283bfbe1..07a7f9f9 100644 --- a/examples/standalone/package.json +++ b/examples/standalone/package.json @@ -18,7 +18,7 @@ "@oplayer/dash": "workspace:*", "@oplayer/hls": "workspace:*", "@oplayer/ui": "workspace:*", - "hls.js": "^1.2.5", + "hls.js": "^1.2.7", "lit": "^2.4.1" } } diff --git a/package.json b/package.json index dfef2ff1..b75a11cc 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@babel/plugin-proposal-object-rest-spread": "^7.20.2", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-transform-destructuring": "^7.20.2", - "@babel/plugin-transform-parameters": "^7.20.1", + "@babel/plugin-transform-parameters": "^7.20.3", "@babel/plugin-transform-spread": "^7.19.0", "@babel/plugin-transform-template-literals": "^7.18.9", "@changesets/cli": "^2.25.2", @@ -46,7 +46,7 @@ "terser": "^5.15.1", "tslib": "^2.4.1", "typescript": "^4.8.4", - "vite": "^3.2.2", + "vite": "^3.2.3", "vite-plugin-banner": "^0.6.1" } } diff --git a/packages/core/src/player.ts b/packages/core/src/player.ts index 4a2212c1..65f8d5ef 100644 --- a/packages/core/src/player.ts +++ b/packages/core/src/player.ts @@ -343,9 +343,10 @@ export class Player { this.isCustomLoader = false } - async changeQuality(src: string) { - this.emit('videoqualitychange', src) - await this.load({ src }) + async changeQuality(source: Omit) { + this._resetStatus() + this.emit('videoqualitychange', source) + await this.load(source) } async changeSource(source: Source) { diff --git a/packages/dash/package.json b/packages/dash/package.json index 1e7a3ced..ea002280 100644 --- a/packages/dash/package.json +++ b/packages/dash/package.json @@ -35,6 +35,6 @@ }, "devDependencies": { "@oplayer/core": "workspace:*", - "dashjs": "^4.5.0" + "dashjs": "^4.5.1" } } diff --git a/packages/hls/package.json b/packages/hls/package.json index 8f6545fa..9ccf4433 100644 --- a/packages/hls/package.json +++ b/packages/hls/package.json @@ -35,6 +35,6 @@ }, "devDependencies": { "@oplayer/core": "workspace:*", - "hls.js": "^1.2.5" + "hls.js": "^1.2.7" } } diff --git a/packages/torrent/package.json b/packages/torrent/package.json index 58276483..788e5618 100644 --- a/packages/torrent/package.json +++ b/packages/torrent/package.json @@ -35,6 +35,6 @@ }, "devDependencies": { "@oplayer/core": "workspace:*", - "webtorrent": "^1.9.1" + "webtorrent": "^1.9.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c2d7da2e..90b0bc33 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,7 +8,7 @@ importers: '@babel/plugin-proposal-object-rest-spread': ^7.20.2 '@babel/plugin-syntax-dynamic-import': ^7.8.3 '@babel/plugin-transform-destructuring': ^7.20.2 - '@babel/plugin-transform-parameters': ^7.20.1 + '@babel/plugin-transform-parameters': ^7.20.3 '@babel/plugin-transform-spread': ^7.19.0 '@babel/plugin-transform-template-literals': ^7.18.9 '@changesets/cli': ^2.25.2 @@ -25,20 +25,20 @@ importers: terser: ^5.15.1 tslib: ^2.4.1 typescript: ^4.8.4 - vite: ^3.2.2 + vite: ^3.2.3 vite-plugin-banner: ^0.6.1 devDependencies: '@babel/core': 7.20.2 '@babel/plugin-proposal-object-rest-spread': 7.20.2_@babel+core@7.20.2 '@babel/plugin-syntax-dynamic-import': 7.8.3_@babel+core@7.20.2 '@babel/plugin-transform-destructuring': 7.20.2_@babel+core@7.20.2 - '@babel/plugin-transform-parameters': 7.20.1_@babel+core@7.20.2 + '@babel/plugin-transform-parameters': 7.20.3_@babel+core@7.20.2 '@babel/plugin-transform-spread': 7.19.0_@babel+core@7.20.2 '@babel/plugin-transform-template-literals': 7.18.9_@babel+core@7.20.2 '@changesets/cli': 2.25.2 '@rollup/plugin-babel': 6.0.2_@babel+core@7.20.2 '@types/node': 18.11.9 - '@vitejs/plugin-react': 2.2.0_vite@3.2.2 + '@vitejs/plugin-react': 2.2.0_vite@3.2.3 babel-plugin-syntax-trailing-function-commas: 6.22.0 concurrently: 7.5.0 cross-env: 7.0.3 @@ -49,7 +49,7 @@ importers: terser: 5.15.1 tslib: 2.4.1 typescript: 4.8.4 - vite: 3.2.2_terser@5.15.1 + vite: 3.2.3_vt5mbdnyaskrzqlb5l6kjsnhi4 vite-plugin-banner: 0.6.1 examples/standalone: @@ -60,7 +60,7 @@ importers: '@oplayer/dash': workspace:* '@oplayer/hls': workspace:* '@oplayer/ui': workspace:* - hls.js: ^1.2.5 + hls.js: ^1.2.7 lit: ^2.4.1 dependencies: '@oplayer/ad': link:../../packages/ad @@ -69,7 +69,7 @@ importers: '@oplayer/dash': link:../../packages/dash '@oplayer/hls': link:../../packages/hls '@oplayer/ui': link:../../packages/ui - hls.js: 1.2.5 + hls.js: 1.2.7 lit: 2.4.1 packages/ad: @@ -90,18 +90,18 @@ importers: packages/dash: specifiers: '@oplayer/core': workspace:* - dashjs: ^4.5.0 + dashjs: ^4.5.1 devDependencies: '@oplayer/core': link:../core - dashjs: 4.5.0 + dashjs: 4.5.1 packages/hls: specifiers: '@oplayer/core': workspace:* - hls.js: ^1.2.5 + hls.js: ^1.2.7 devDependencies: '@oplayer/core': link:../core - hls.js: 1.2.5 + hls.js: 1.2.7 packages/react: specifiers: @@ -136,10 +136,10 @@ importers: packages/torrent: specifiers: '@oplayer/core': workspace:* - webtorrent: ^1.9.1 + webtorrent: ^1.9.2 devDependencies: '@oplayer/core': link:../core - webtorrent: 1.9.1 + webtorrent: 1.9.2 packages/ui: specifiers: @@ -175,11 +175,11 @@ packages: dependencies: '@ampproject/remapping': 2.2.0 '@babel/code-frame': 7.18.6 - '@babel/generator': 7.20.2 + '@babel/generator': 7.20.4 '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.20.2 '@babel/helper-module-transforms': 7.20.2 '@babel/helpers': 7.20.1 - '@babel/parser': 7.20.2 + '@babel/parser': 7.20.3 '@babel/template': 7.18.10 '@babel/traverse': 7.20.1 '@babel/types': 7.20.2 @@ -192,8 +192,8 @@ packages: - supports-color dev: true - /@babel/generator/7.20.2: - resolution: {integrity: sha512-SD75PMIK6i9H8G/tfGvB4KKl4Nw6Ssos9nGgYwxbgyTP0iX/Z55DveoH86rmUB/YHTQQ+ZC0F7xxaY8l2OF44Q==} + /@babel/generator/7.20.4: + resolution: {integrity: sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.20.2 @@ -325,8 +325,8 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser/7.20.2: - resolution: {integrity: sha512-afk318kh2uKbo7BEj2QtEi8HVCGrwHUffrYDy7dgVcSa2j9lY3LDjPzcyGdpX7xgm35aWqvciZJ4WKmdF/SxYg==} + /@babel/parser/7.20.3: + resolution: {integrity: sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==} engines: {node: '>=6.0.0'} hasBin: true dependencies: @@ -344,7 +344,7 @@ packages: '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.20.2 '@babel/helper-plugin-utils': 7.20.2 '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.20.2 - '@babel/plugin-transform-parameters': 7.20.1_@babel+core@7.20.2 + '@babel/plugin-transform-parameters': 7.20.3_@babel+core@7.20.2 dev: true /@babel/plugin-syntax-dynamic-import/7.8.3_@babel+core@7.20.2: @@ -385,8 +385,8 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-transform-parameters/7.20.1_@babel+core@7.20.2: - resolution: {integrity: sha512-nDvKLrAvl+kf6BOy1UJ3MGwzzfTMgppxwiD2Jb4LO3xjYyZq30oQzDNJbCQpMdG9+j2IXHoiMrw5Cm/L6ZoxXQ==} + /@babel/plugin-transform-parameters/7.20.3_@babel+core@7.20.2: + resolution: {integrity: sha512-oZg/Fpx0YDrj13KsLyO8I/CX3Zdw7z0O9qOd95SqcoIzuqy/WTGWvePeHAnZCN54SfdyjHcb1S30gc8zlzlHcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -471,7 +471,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/parser': 7.20.2 + '@babel/parser': 7.20.3 '@babel/types': 7.20.2 dev: true @@ -480,12 +480,12 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/generator': 7.20.2 + '@babel/generator': 7.20.4 '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-function-name': 7.19.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.20.2 + '@babel/parser': 7.20.3 '@babel/types': 7.20.2 debug: 4.3.4 globals: 11.12.0 @@ -1288,7 +1288,7 @@ packages: resolution: {integrity: sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==} dev: false - /@vitejs/plugin-react/2.2.0_vite@3.2.2: + /@vitejs/plugin-react/2.2.0_vite@3.2.3: resolution: {integrity: sha512-FFpefhvExd1toVRlokZgxgy2JtnBOdp4ZDsq7ldCWaqGSGn9UhWMAVm/1lxPL14JfNS5yGz+s9yFrQY6shoStA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -1301,7 +1301,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.19.6_@babel+core@7.20.2 magic-string: 0.26.7 react-refresh: 0.14.0 - vite: 3.2.2_terser@5.15.1 + vite: 3.2.3_vt5mbdnyaskrzqlb5l6kjsnhi4 transitivePeerDependencies: - supports-color dev: true @@ -1317,8 +1317,8 @@ packages: resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==} dev: true - /@yarnpkg/parsers/3.0.0-rc.27: - resolution: {integrity: sha512-qs2wZulOYVjaOS6tYOs3SsR7m/qeHwjPrB5i4JtBJELsgWrEkyL+rJH21RA+fVwttJobAYQqw5Xj5SYLaDK/bQ==} + /@yarnpkg/parsers/3.0.0-rc.28: + resolution: {integrity: sha512-OdBYBaACPjFnqek4jtyR5VH7wX5i7BwfS0AP8m6hTqgULRVOLEc6TKxUBxMCTISzZPGdo5wWAB7OcMmU6G2UnA==} engines: {node: '>=14.15.0'} dependencies: js-yaml: 3.14.1 @@ -1673,6 +1673,10 @@ packages: resolution: {integrity: sha512-BF033y5fN6OCofD3vgHmNtwZWRcq9NLyyxyILx9hfMy1sXYy4ojFl765hJ2lP0YaN2fuxPaLO2Vzzoxy0FLFFA==} dev: true + /block-iterator/1.0.1: + resolution: {integrity: sha512-ral9Gh8BXqVkh4lnhLLL5QJ67+VMOBNzsHJZX4n+Pwer9bzcSM2ZOjTLMErkWWETvnis+ZP1a6EULebjEg3bTA==} + dev: true + /block-stream2/2.1.0: resolution: {integrity: sha512-suhjmLI57Ewpmq00qaygS8UgEq2ly2PCItenIyhMqVjo4t4pGzqMvfgJuX8iWTeSDdfSSqS6j38fL4ToNL7Pfg==} dependencies: @@ -1719,7 +1723,7 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001430 + caniuse-lite: 1.0.30001431 electron-to-chromium: 1.4.284 node-releases: 2.0.6 update-browserslist-db: 1.0.10_browserslist@4.21.4 @@ -1797,8 +1801,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite/1.0.30001430: - resolution: {integrity: sha512-IB1BXTZKPDVPM7cnV4iaKaHxckvdr/3xtctB3f7Hmenx3qYBhGtTZ//7EllK66aKXW98Lx0+7Yr0kxBtIt3tzg==} + /caniuse-lite/1.0.30001431: + resolution: {integrity: sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==} dev: true /canvas/1.3.12: @@ -2058,24 +2062,22 @@ packages: resolution: {integrity: sha512-PXHBvGLuL69u55IkLa5e5838fLhIMHxmkV4ge42a8alGyn7BtawYgI0hQ849EedvtHIOLNNH3i6eQU1BiE9SUA==} dev: true - /create-torrent/5.0.6: - resolution: {integrity: sha512-T3C23ZXdgzp6GrmbR3eJ9WSzmsR2ORvsTkr2Md32zmkYyzPmZyK+BayzaZt4kAahCKaLxvpMsvtITP0/WH1Z9g==} + /create-torrent/5.0.9: + resolution: {integrity: sha512-WQ/bMe+aCBSa5EonIkgw7CTM/1JnJDQuLJhA78omSWvuEbXDwaUy0rG3a+IYt+EiO+rdTLxdsBwrsn/wfWOMQA==} engines: {node: '>=12'} hasBin: true dependencies: bencode: 2.0.3 - block-stream2: 2.1.0 - fast-blob-stream: 1.1.1 + block-iterator: 1.0.1 + fast-readable-async-iterator: 1.1.1 is-file: 1.0.0 join-async-iterator: 1.1.1 junk: 3.1.0 minimist: 1.2.7 - once: 1.4.0 piece-length: 2.0.1 queue-microtask: 1.2.3 run-parallel: 1.2.0 simple-sha1: 3.1.0 - streamx: 2.12.5 dev: true /cross-env/7.0.3: @@ -2136,8 +2138,8 @@ packages: assert-plus: 1.0.0 dev: false - /dashjs/4.5.0: - resolution: {integrity: sha512-gPoK98+YOpC72wCaBilYhXTDj6ZMMrXtCo/4sljQn4LTW9LnK7v7+ZLwLOuouvTuzporx4CgT5VWJqxeNrV7vg==} + /dashjs/4.5.1: + resolution: {integrity: sha512-pC5p+cSsXMJGuGgtt21ccpNkENhu6/2+niTU1Krq18Zr9dSMAO4J9jv4IlAJnWAok8hRDKyV9a1jskUiGPCnKQ==} dependencies: bcp-47-match: 1.0.3 bcp-47-normalize: 1.1.1 @@ -2317,8 +2319,8 @@ packages: object.assign: 4.1.4 regexp.prototype.flags: 1.4.3 safe-regex-test: 1.0.0 - string.prototype.trimend: 1.0.5 - string.prototype.trimstart: 1.0.5 + string.prototype.trimend: 1.0.6 + string.prototype.trimstart: 1.0.6 unbox-primitive: 1.0.2 dev: true @@ -3040,8 +3042,8 @@ packages: function-bind: 1.1.1 dev: true - /hls.js/1.2.5: - resolution: {integrity: sha512-1xW5PBJcQu2MsQDnqoFtCfaxxJ1hHwJHRThxDtrKRcrltTtSi4A62xgOsey+KK8MTMD6i4w5fcmBBz1U62ihvQ==} + /hls.js/1.2.7: + resolution: {integrity: sha512-mD4Po7Q5TPNIYX6G8sDD+RS/xfrWjMjrtp+xPw3Thw8Tq557Vn0wdXIX/Zii28F9ncUMMQPZsGkoCWFna9CZCw==} /hosted-git-info/2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -4030,7 +4032,7 @@ packages: '@nrwl/tao': 15.0.13 '@parcel/watcher': 2.0.4 '@yarnpkg/lockfile': 1.1.0 - '@yarnpkg/parsers': 3.0.0-rc.27 + '@yarnpkg/parsers': 3.0.0-rc.28 '@zkochan/js-yaml': 0.0.6 axios: 1.1.3 chalk: 4.1.0 @@ -4331,8 +4333,8 @@ packages: engines: {node: '>=4.0.0'} dev: false - /postcss/8.4.18: - resolution: {integrity: sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA==} + /postcss/8.4.19: + resolution: {integrity: sha512-h+pbPsyhlYj6N2ozBmHhHrs9DzGmbaarbLvWipMRO7RLS+v4onj26MPFXA5OBYFxyqYhUJK456SwDcY9H2/zsA==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.4 @@ -5017,16 +5019,16 @@ packages: strip-ansi: 7.0.1 dev: true - /string.prototype.trimend/1.0.5: - resolution: {integrity: sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==} + /string.prototype.trimend/1.0.6: + resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} dependencies: call-bind: 1.0.2 define-properties: 1.1.4 es-abstract: 1.20.4 dev: true - /string.prototype.trimstart/1.0.5: - resolution: {integrity: sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==} + /string.prototype.trimstart/1.0.6: + resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} dependencies: call-bind: 1.0.2 define-properties: 1.1.4 @@ -5452,17 +5454,20 @@ packages: resolution: {integrity: sha512-E5abFbnqO21R1dCFwoRYAIcJArX3XAMZv1zV4uU9PcWQNt1PaWtj5SP1QcnbyXn2FhWSnvPkJp7yP16DeA/BzA==} dev: true - /vite/3.2.2_terser@5.15.1: - resolution: {integrity: sha512-pLrhatFFOWO9kS19bQ658CnRYzv0WLbsPih6R+iFeEEhDOuYgYCX2rztUViMz/uy/V8cLCJvLFeiOK7RJEzHcw==} + /vite/3.2.3_vt5mbdnyaskrzqlb5l6kjsnhi4: + resolution: {integrity: sha512-h8jl1TZ76eGs3o2dIBSsvXDLb1m/Ec1iej8ZMdz+PsaFUsftZeWe2CZOI3qogEsMNaywc17gu0q6cQDzh/weCQ==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: + '@types/node': '>= 14' less: '*' sass: '*' stylus: '*' sugarss: '*' terser: ^5.4.0 peerDependenciesMeta: + '@types/node': + optional: true less: optional: true sass: @@ -5474,8 +5479,9 @@ packages: terser: optional: true dependencies: + '@types/node': 18.11.9 esbuild: 0.15.13 - postcss: 8.4.18 + postcss: 8.4.19 resolve: 1.22.1 rollup: 2.79.1 terser: 5.15.1 @@ -5488,8 +5494,8 @@ packages: dependencies: defaults: 1.0.4 - /webtorrent/1.9.1: - resolution: {integrity: sha512-lFVMY1+GmTJlPAzEuWqQKP3/83c4bGFuJGPjI0lFRgYvUeQqxHv2Qwriz1SOK96MKuhMPKS9y4kf1CddZzoBjQ==} + /webtorrent/1.9.2: + resolution: {integrity: sha512-+ZnUJGBVQWtZUdejGLZho9q7GLi/lo82zf4H3FeQqxzZBL3HOFfBW7BnofLaww1oYTTKVE42nmeBJksibvSUlQ==} engines: {node: '>=14'} dependencies: '@webtorrent/http-node': 1.3.0 @@ -5501,7 +5507,7 @@ packages: chrome-net: 3.3.4 chunk-store-stream: 4.3.0 cpus: 1.0.3 - create-torrent: 5.0.6 + create-torrent: 5.0.9 debug: 4.3.4 end-of-stream: 1.4.4 escape-html: 1.0.3