feat(video-player): 添加视频多码率切换功能支持
添加 videojs-contrib-quality-levels 和 videojs-hls-quality-selector 依赖 在视频播放器中集成多码率切换功能,支持七牛云多码率 .m3u8 地址 自动在控制条显示清晰度切换菜单(PC/Android端)
Showing
3 changed files
with
107 additions
and
17 deletions
| ... | @@ -48,6 +48,8 @@ | ... | @@ -48,6 +48,8 @@ |
| 48 | "vant": "^4.9.22", | 48 | "vant": "^4.9.22", |
| 49 | "vconsole": "^3.15.1", | 49 | "vconsole": "^3.15.1", |
| 50 | "video.js": "^7.21.7", | 50 | "video.js": "^7.21.7", |
| 51 | + "videojs-contrib-quality-levels": "^2.2.1", | ||
| 52 | + "videojs-hls-quality-selector": "1.1.4", | ||
| 51 | "vue": "^3.5.13", | 53 | "vue": "^3.5.13", |
| 52 | "vue-demi": "0.14.6", | 54 | "vue-demi": "0.14.6", |
| 53 | "vue-router": "^4.5.0", | 55 | "vue-router": "^4.5.0", | ... | ... |
| ... | @@ -83,6 +83,12 @@ importers: | ... | @@ -83,6 +83,12 @@ importers: |
| 83 | video.js: | 83 | video.js: |
| 84 | specifier: ^7.21.7 | 84 | specifier: ^7.21.7 |
| 85 | version: 7.21.7 | 85 | version: 7.21.7 |
| 86 | + videojs-contrib-quality-levels: | ||
| 87 | + specifier: ^2.2.1 | ||
| 88 | + version: 2.2.1(video.js@7.21.7) | ||
| 89 | + videojs-hls-quality-selector: | ||
| 90 | + specifier: 1.1.4 | ||
| 91 | + version: 1.1.4 | ||
| 86 | vue: | 92 | vue: |
| 87 | specifier: ^3.5.13 | 93 | specifier: ^3.5.13 |
| 88 | version: 3.5.25 | 94 | version: 3.5.25 |
| ... | @@ -1172,6 +1178,9 @@ packages: | ... | @@ -1172,6 +1178,9 @@ packages: |
| 1172 | fraction.js@5.3.4: | 1178 | fraction.js@5.3.4: |
| 1173 | resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==} | 1179 | resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==} |
| 1174 | 1180 | ||
| 1181 | + fs-extra@0.26.7: | ||
| 1182 | + resolution: {integrity: sha512-waKu+1KumRhYv8D8gMRCKJGAMI9pRnPuEb1mvgYD0f7wBscg+h6bW4FDTmEZhB9VKxvoTtxW+Y7bnIlB7zja6Q==} | ||
| 1183 | + | ||
| 1175 | fs-extra@11.3.2: | 1184 | fs-extra@11.3.2: |
| 1176 | resolution: {integrity: sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==} | 1185 | resolution: {integrity: sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==} |
| 1177 | engines: {node: '>=14.14'} | 1186 | engines: {node: '>=14.14'} |
| ... | @@ -1180,6 +1189,10 @@ packages: | ... | @@ -1180,6 +1189,10 @@ packages: |
| 1180 | resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} | 1189 | resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} |
| 1181 | engines: {node: '>= 8'} | 1190 | engines: {node: '>= 8'} |
| 1182 | 1191 | ||
| 1192 | + fs-promise@0.5.0: | ||
| 1193 | + resolution: {integrity: sha512-Y+4F4ujhEcayCJt6JmzcOun9MYGQwz+bVUiuBmTkJImhBHKpBvmVPZR9wtfiF7k3ffwAOAuurygQe+cPLSFQhw==} | ||
| 1194 | + deprecated: Use mz or fs-extra^3.0 with Promise Support | ||
| 1195 | + | ||
| 1183 | fs.realpath@1.0.0: | 1196 | fs.realpath@1.0.0: |
| 1184 | resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} | 1197 | resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} |
| 1185 | 1198 | ||
| ... | @@ -1336,12 +1349,22 @@ packages: | ... | @@ -1336,12 +1349,22 @@ packages: |
| 1336 | engines: {node: '>=6'} | 1349 | engines: {node: '>=6'} |
| 1337 | hasBin: true | 1350 | hasBin: true |
| 1338 | 1351 | ||
| 1352 | + jsonfile@2.4.0: | ||
| 1353 | + resolution: {integrity: sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==} | ||
| 1354 | + | ||
| 1339 | jsonfile@6.2.0: | 1355 | jsonfile@6.2.0: |
| 1340 | resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==} | 1356 | resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==} |
| 1341 | 1357 | ||
| 1358 | + karma-safaritechpreview-launcher@0.0.6: | ||
| 1359 | + resolution: {integrity: sha512-2QMxAGXPQ37H3KoR9SCdh0OoktQZ5MyrxkvBiZ+VVOQfYVrcyOQXGrPea0/DKvf8qoQvrvP2FHcP/BxsuxuyHw==} | ||
| 1360 | + engines: {node: '>=4'} | ||
| 1361 | + | ||
| 1342 | keycode@2.2.1: | 1362 | keycode@2.2.1: |
| 1343 | resolution: {integrity: sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg==} | 1363 | resolution: {integrity: sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg==} |
| 1344 | 1364 | ||
| 1365 | + klaw@1.3.1: | ||
| 1366 | + resolution: {integrity: sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==} | ||
| 1367 | + | ||
| 1345 | less@4.4.2: | 1368 | less@4.4.2: |
| 1346 | resolution: {integrity: sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==} | 1369 | resolution: {integrity: sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==} |
| 1347 | engines: {node: '>=14'} | 1370 | engines: {node: '>=14'} |
| ... | @@ -1392,6 +1415,10 @@ packages: | ... | @@ -1392,6 +1415,10 @@ packages: |
| 1392 | resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} | 1415 | resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} |
| 1393 | engines: {node: '>=8'} | 1416 | engines: {node: '>=8'} |
| 1394 | 1417 | ||
| 1418 | + marcosc-async@3.0.5: | ||
| 1419 | + resolution: {integrity: sha512-CCDofAatyNlbCCE1aIERplqT8r4S3LLc72pg3Bg/RilWPFqdXYO/FiDfzZ9ijf7K1P0j5mUZYCQ6eWXNuAxNBg==} | ||
| 1420 | + engines: {'0': '>', '1': '=', '2': '4'} | ||
| 1421 | + | ||
| 1395 | math-intrinsics@1.1.0: | 1422 | math-intrinsics@1.1.0: |
| 1396 | resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} | 1423 | resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} |
| 1397 | engines: {node: '>= 0.4'} | 1424 | engines: {node: '>= 0.4'} |
| ... | @@ -1708,6 +1735,11 @@ packages: | ... | @@ -1708,6 +1735,11 @@ packages: |
| 1708 | resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} | 1735 | resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} |
| 1709 | engines: {iojs: '>=1.0.0', node: '>=0.10.0'} | 1736 | engines: {iojs: '>=1.0.0', node: '>=0.10.0'} |
| 1710 | 1737 | ||
| 1738 | + rimraf@2.7.1: | ||
| 1739 | + resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} | ||
| 1740 | + deprecated: Rimraf versions prior to v4 are no longer supported | ||
| 1741 | + hasBin: true | ||
| 1742 | + | ||
| 1711 | rimraf@3.0.2: | 1743 | rimraf@3.0.2: |
| 1712 | resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} | 1744 | resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} |
| 1713 | deprecated: Rimraf versions prior to v4 are no longer supported | 1745 | deprecated: Rimraf versions prior to v4 are no longer supported |
| ... | @@ -1974,9 +2006,17 @@ packages: | ... | @@ -1974,9 +2006,17 @@ packages: |
| 1974 | video.js@7.21.7: | 2006 | video.js@7.21.7: |
| 1975 | resolution: {integrity: sha512-T2s3WFAht7Zjr2OSJamND9x9Dn2O+Z5WuHGdh8jI5SYh5mkMdVTQ7vSRmA5PYpjXJ2ycch6jpMjkJEIEU2xxqw==} | 2007 | resolution: {integrity: sha512-T2s3WFAht7Zjr2OSJamND9x9Dn2O+Z5WuHGdh8jI5SYh5mkMdVTQ7vSRmA5PYpjXJ2ycch6jpMjkJEIEU2xxqw==} |
| 1976 | 2008 | ||
| 2009 | + videojs-contrib-quality-levels@2.2.1: | ||
| 2010 | + resolution: {integrity: sha512-cnF6OGGgoC/2nUrbdz54nzPm3BpEZQzMTpyekiX6AXs8imATX2sHbrUz97xXVSHITldk/+d7ZAUrdQYJJTyuug==} | ||
| 2011 | + peerDependencies: | ||
| 2012 | + video.js: ^6 || ^7 || ^8 | ||
| 2013 | + | ||
| 1977 | videojs-font@3.2.0: | 2014 | videojs-font@3.2.0: |
| 1978 | resolution: {integrity: sha512-g8vHMKK2/JGorSfqAZQUmYYNnXmfec4MLhwtEFS+mMs2IDY398GLysy6BH6K+aS1KMNu/xWZ8Sue/X/mdQPliA==} | 2015 | resolution: {integrity: sha512-g8vHMKK2/JGorSfqAZQUmYYNnXmfec4MLhwtEFS+mMs2IDY398GLysy6BH6K+aS1KMNu/xWZ8Sue/X/mdQPliA==} |
| 1979 | 2016 | ||
| 2017 | + videojs-hls-quality-selector@1.1.4: | ||
| 2018 | + resolution: {integrity: sha512-wWAjlLQui02gp//t9KHGd3XnbYO7wdOptskh3ZYCrbl/5Lbkveqb9yBVjH4e0zIQBPvGdWPMcOeDukf8iuYeBw==} | ||
| 2019 | + | ||
| 1980 | videojs-vtt.js@0.15.5: | 2020 | videojs-vtt.js@0.15.5: |
| 1981 | resolution: {integrity: sha512-yZbBxvA7QMYn15Lr/ZfhhLPrNpI/RmCSCqgIff57GC2gIrV5YfyzLfLyZMj0NnZSAz8syB4N0nHXpZg9MyrMOQ==} | 2021 | resolution: {integrity: sha512-yZbBxvA7QMYn15Lr/ZfhhLPrNpI/RmCSCqgIff57GC2gIrV5YfyzLfLyZMj0NnZSAz8syB4N0nHXpZg9MyrMOQ==} |
| 1982 | 2022 | ||
| ... | @@ -2894,8 +2934,7 @@ snapshots: | ... | @@ -2894,8 +2934,7 @@ snapshots: |
| 2894 | transitivePeerDependencies: | 2934 | transitivePeerDependencies: |
| 2895 | - debug | 2935 | - debug |
| 2896 | 2936 | ||
| 2897 | - balanced-match@1.0.2: | 2937 | + balanced-match@1.0.2: {} |
| 2898 | - optional: true | ||
| 2899 | 2938 | ||
| 2900 | base64-arraybuffer@1.0.2: {} | 2939 | base64-arraybuffer@1.0.2: {} |
| 2901 | 2940 | ||
| ... | @@ -2907,7 +2946,6 @@ snapshots: | ... | @@ -2907,7 +2946,6 @@ snapshots: |
| 2907 | dependencies: | 2946 | dependencies: |
| 2908 | balanced-match: 1.0.2 | 2947 | balanced-match: 1.0.2 |
| 2909 | concat-map: 0.0.1 | 2948 | concat-map: 0.0.1 |
| 2910 | - optional: true | ||
| 2911 | 2949 | ||
| 2912 | braces@3.0.3: | 2950 | braces@3.0.3: |
| 2913 | dependencies: | 2951 | dependencies: |
| ... | @@ -3001,8 +3039,7 @@ snapshots: | ... | @@ -3001,8 +3039,7 @@ snapshots: |
| 3001 | 3039 | ||
| 3002 | compute-scroll-into-view@1.0.20: {} | 3040 | compute-scroll-into-view@1.0.20: {} |
| 3003 | 3041 | ||
| 3004 | - concat-map@0.0.1: | 3042 | + concat-map@0.0.1: {} |
| 3005 | - optional: true | ||
| 3006 | 3043 | ||
| 3007 | confbox@0.1.8: {} | 3044 | confbox@0.1.8: {} |
| 3008 | 3045 | ||
| ... | @@ -3178,6 +3215,14 @@ snapshots: | ... | @@ -3178,6 +3215,14 @@ snapshots: |
| 3178 | 3215 | ||
| 3179 | fraction.js@5.3.4: {} | 3216 | fraction.js@5.3.4: {} |
| 3180 | 3217 | ||
| 3218 | + fs-extra@0.26.7: | ||
| 3219 | + dependencies: | ||
| 3220 | + graceful-fs: 4.2.11 | ||
| 3221 | + jsonfile: 2.4.0 | ||
| 3222 | + klaw: 1.3.1 | ||
| 3223 | + path-is-absolute: 1.0.1 | ||
| 3224 | + rimraf: 2.7.1 | ||
| 3225 | + | ||
| 3181 | fs-extra@11.3.2: | 3226 | fs-extra@11.3.2: |
| 3182 | dependencies: | 3227 | dependencies: |
| 3183 | graceful-fs: 4.2.11 | 3228 | graceful-fs: 4.2.11 |
| ... | @@ -3189,8 +3234,14 @@ snapshots: | ... | @@ -3189,8 +3234,14 @@ snapshots: |
| 3189 | minipass: 3.3.6 | 3234 | minipass: 3.3.6 |
| 3190 | optional: true | 3235 | optional: true |
| 3191 | 3236 | ||
| 3192 | - fs.realpath@1.0.0: | 3237 | + fs-promise@0.5.0: |
| 3193 | - optional: true | 3238 | + dependencies: |
| 3239 | + any-promise: 1.3.0 | ||
| 3240 | + fs-extra: 0.26.7 | ||
| 3241 | + mz: 2.7.0 | ||
| 3242 | + thenify-all: 1.6.0 | ||
| 3243 | + | ||
| 3244 | + fs.realpath@1.0.0: {} | ||
| 3194 | 3245 | ||
| 3195 | fsevents@2.3.3: | 3246 | fsevents@2.3.3: |
| 3196 | optional: true | 3247 | optional: true |
| ... | @@ -3248,7 +3299,6 @@ snapshots: | ... | @@ -3248,7 +3299,6 @@ snapshots: |
| 3248 | minimatch: 3.1.2 | 3299 | minimatch: 3.1.2 |
| 3249 | once: 1.4.0 | 3300 | once: 1.4.0 |
| 3250 | path-is-absolute: 1.0.1 | 3301 | path-is-absolute: 1.0.1 |
| 3251 | - optional: true | ||
| 3252 | 3302 | ||
| 3253 | global@4.4.0: | 3303 | global@4.4.0: |
| 3254 | dependencies: | 3304 | dependencies: |
| ... | @@ -3303,10 +3353,8 @@ snapshots: | ... | @@ -3303,10 +3353,8 @@ snapshots: |
| 3303 | dependencies: | 3353 | dependencies: |
| 3304 | once: 1.4.0 | 3354 | once: 1.4.0 |
| 3305 | wrappy: 1.0.2 | 3355 | wrappy: 1.0.2 |
| 3306 | - optional: true | ||
| 3307 | 3356 | ||
| 3308 | - inherits@2.0.4: | 3357 | + inherits@2.0.4: {} |
| 3309 | - optional: true | ||
| 3310 | 3358 | ||
| 3311 | is-binary-path@2.1.0: | 3359 | is-binary-path@2.1.0: |
| 3312 | dependencies: | 3360 | dependencies: |
| ... | @@ -3342,14 +3390,27 @@ snapshots: | ... | @@ -3342,14 +3390,27 @@ snapshots: |
| 3342 | 3390 | ||
| 3343 | json5@2.2.3: {} | 3391 | json5@2.2.3: {} |
| 3344 | 3392 | ||
| 3393 | + jsonfile@2.4.0: | ||
| 3394 | + optionalDependencies: | ||
| 3395 | + graceful-fs: 4.2.11 | ||
| 3396 | + | ||
| 3345 | jsonfile@6.2.0: | 3397 | jsonfile@6.2.0: |
| 3346 | dependencies: | 3398 | dependencies: |
| 3347 | universalify: 2.0.1 | 3399 | universalify: 2.0.1 |
| 3348 | optionalDependencies: | 3400 | optionalDependencies: |
| 3349 | graceful-fs: 4.2.11 | 3401 | graceful-fs: 4.2.11 |
| 3350 | 3402 | ||
| 3403 | + karma-safaritechpreview-launcher@0.0.6: | ||
| 3404 | + dependencies: | ||
| 3405 | + fs-promise: 0.5.0 | ||
| 3406 | + marcosc-async: 3.0.5 | ||
| 3407 | + | ||
| 3351 | keycode@2.2.1: {} | 3408 | keycode@2.2.1: {} |
| 3352 | 3409 | ||
| 3410 | + klaw@1.3.1: | ||
| 3411 | + optionalDependencies: | ||
| 3412 | + graceful-fs: 4.2.11 | ||
| 3413 | + | ||
| 3353 | less@4.4.2: | 3414 | less@4.4.2: |
| 3354 | dependencies: | 3415 | dependencies: |
| 3355 | copy-anything: 2.0.6 | 3416 | copy-anything: 2.0.6 |
| ... | @@ -3413,6 +3474,8 @@ snapshots: | ... | @@ -3413,6 +3474,8 @@ snapshots: |
| 3413 | semver: 6.3.1 | 3474 | semver: 6.3.1 |
| 3414 | optional: true | 3475 | optional: true |
| 3415 | 3476 | ||
| 3477 | + marcosc-async@3.0.5: {} | ||
| 3478 | + | ||
| 3416 | math-intrinsics@1.1.0: {} | 3479 | math-intrinsics@1.1.0: {} |
| 3417 | 3480 | ||
| 3418 | merge2@1.4.1: {} | 3481 | merge2@1.4.1: {} |
| ... | @@ -3441,7 +3504,6 @@ snapshots: | ... | @@ -3441,7 +3504,6 @@ snapshots: |
| 3441 | minimatch@3.1.2: | 3504 | minimatch@3.1.2: |
| 3442 | dependencies: | 3505 | dependencies: |
| 3443 | brace-expansion: 1.1.12 | 3506 | brace-expansion: 1.1.12 |
| 3444 | - optional: true | ||
| 3445 | 3507 | ||
| 3446 | minipass@3.3.6: | 3508 | minipass@3.3.6: |
| 3447 | dependencies: | 3509 | dependencies: |
| ... | @@ -3535,7 +3597,6 @@ snapshots: | ... | @@ -3535,7 +3597,6 @@ snapshots: |
| 3535 | once@1.4.0: | 3597 | once@1.4.0: |
| 3536 | dependencies: | 3598 | dependencies: |
| 3537 | wrappy: 1.0.2 | 3599 | wrappy: 1.0.2 |
| 3538 | - optional: true | ||
| 3539 | 3600 | ||
| 3540 | p-limit@2.3.0: | 3601 | p-limit@2.3.0: |
| 3541 | dependencies: | 3602 | dependencies: |
| ... | @@ -3551,8 +3612,7 @@ snapshots: | ... | @@ -3551,8 +3612,7 @@ snapshots: |
| 3551 | 3612 | ||
| 3552 | path-exists@4.0.0: {} | 3613 | path-exists@4.0.0: {} |
| 3553 | 3614 | ||
| 3554 | - path-is-absolute@1.0.1: | 3615 | + path-is-absolute@1.0.1: {} |
| 3555 | - optional: true | ||
| 3556 | 3616 | ||
| 3557 | path-parse@1.0.7: {} | 3617 | path-parse@1.0.7: {} |
| 3558 | 3618 | ||
| ... | @@ -3692,6 +3752,10 @@ snapshots: | ... | @@ -3692,6 +3752,10 @@ snapshots: |
| 3692 | 3752 | ||
| 3693 | reusify@1.1.0: {} | 3753 | reusify@1.1.0: {} |
| 3694 | 3754 | ||
| 3755 | + rimraf@2.7.1: | ||
| 3756 | + dependencies: | ||
| 3757 | + glob: 7.2.3 | ||
| 3758 | + | ||
| 3695 | rimraf@3.0.2: | 3759 | rimraf@3.0.2: |
| 3696 | dependencies: | 3760 | dependencies: |
| 3697 | glob: 7.2.3 | 3761 | glob: 7.2.3 |
| ... | @@ -4041,8 +4105,20 @@ snapshots: | ... | @@ -4041,8 +4105,20 @@ snapshots: |
| 4041 | videojs-font: 3.2.0 | 4105 | videojs-font: 3.2.0 |
| 4042 | videojs-vtt.js: 0.15.5 | 4106 | videojs-vtt.js: 0.15.5 |
| 4043 | 4107 | ||
| 4108 | + videojs-contrib-quality-levels@2.2.1(video.js@7.21.7): | ||
| 4109 | + dependencies: | ||
| 4110 | + global: 4.4.0 | ||
| 4111 | + video.js: 7.21.7 | ||
| 4112 | + | ||
| 4044 | videojs-font@3.2.0: {} | 4113 | videojs-font@3.2.0: {} |
| 4045 | 4114 | ||
| 4115 | + videojs-hls-quality-selector@1.1.4: | ||
| 4116 | + dependencies: | ||
| 4117 | + global: 4.4.0 | ||
| 4118 | + karma-safaritechpreview-launcher: 0.0.6 | ||
| 4119 | + video.js: 7.21.7 | ||
| 4120 | + videojs-contrib-quality-levels: 2.2.1(video.js@7.21.7) | ||
| 4121 | + | ||
| 4046 | videojs-vtt.js@0.15.5: | 4122 | videojs-vtt.js@0.15.5: |
| 4047 | dependencies: | 4123 | dependencies: |
| 4048 | global: 4.4.0 | 4124 | global: 4.4.0 |
| ... | @@ -4190,8 +4266,7 @@ snapshots: | ... | @@ -4190,8 +4266,7 @@ snapshots: |
| 4190 | string-width: 4.2.3 | 4266 | string-width: 4.2.3 |
| 4191 | strip-ansi: 6.0.1 | 4267 | strip-ansi: 6.0.1 |
| 4192 | 4268 | ||
| 4193 | - wrappy@1.0.2: | 4269 | + wrappy@1.0.2: {} |
| 4194 | - optional: true | ||
| 4195 | 4270 | ||
| 4196 | y18n@4.0.3: {} | 4271 | y18n@4.0.3: {} |
| 4197 | 4272 | ... | ... |
| ... | @@ -4,6 +4,12 @@ import Hls from 'hls.js'; | ... | @@ -4,6 +4,12 @@ import Hls from 'hls.js'; |
| 4 | import videojs from "video.js"; | 4 | import videojs from "video.js"; |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| 7 | + * - 使用方法 :您无需修改业务代码。只要传入的视频 URL 是七牛云生成的多码率 .m3u8 地址,播放器控制条右下角会自动出现“齿轮”图标,用户点击即可切换清晰度(或选择 Auto 自动切换)。 | ||
| 8 | + * - iOS 注意事项 :在 iOS 移动端(尤其是微信),通常使用系统原生播放器,系统会根据网速自动切换码率(ABR),但通常无法显示手动切换菜单,这是 iOS H5 的系统限制。 | ||
| 9 | + * - PC 和 Android 端将正常显示切换菜单。 | ||
| 10 | + */ | ||
| 11 | + | ||
| 12 | +/** | ||
| 7 | * 视频播放核心逻辑 Hook | 13 | * 视频播放核心逻辑 Hook |
| 8 | * 处理不同环境下的播放器选择、HLS支持、自动播放策略等 | 14 | * 处理不同环境下的播放器选择、HLS支持、自动播放策略等 |
| 9 | */ | 15 | */ |
| ... | @@ -291,6 +297,13 @@ export function useVideoPlayer(props, emit, videoRef, nativeVideoRef) { | ... | @@ -291,6 +297,13 @@ export function useVideoPlayer(props, emit, videoRef, nativeVideoRef) { |
| 291 | player.value = payload.player; | 297 | player.value = payload.player; |
| 292 | 298 | ||
| 293 | if (player.value) { | 299 | if (player.value) { |
| 300 | + // 初始化多码率切换插件 (七牛云多码率支持) | ||
| 301 | + if (player.value.hlsQualitySelector) { | ||
| 302 | + player.value.hlsQualitySelector({ | ||
| 303 | + displayCurrentQuality: true, | ||
| 304 | + }); | ||
| 305 | + } | ||
| 306 | + | ||
| 294 | player.value.on('error', () => { | 307 | player.value.on('error', () => { |
| 295 | const err = player.value.error(); | 308 | const err = player.value.error(); |
| 296 | handleError(err?.code, err?.message); | 309 | handleError(err?.code, err?.message); | ... | ... |
-
Please register or login to post a comment