videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.99k stars 7.44k forks source link

Prefetch m3u8 video with Videojs of new version #8034

Open chenbing11 opened 1 year ago

chenbing11 commented 1 year ago

Description

It’s normal to use v7.21.1. When video.js is upgraded to v8.0.2, an error will be reported for m3u8 video (the video is uploaded to Alibaba Cloud Computing OSS)

Reduced test case

No response

Steps to reproduce

As this is a private project, so cannot share any URLs/Creds.

Errors

Uncaught TypeError: Class constructor EventTarget$2 cannot be invoked without 'new' at new QualityLevelList2 (video.es.js:25503:34) at initPlugin (video.es.js:25657:26) at Player.qualityLevels2 (video.es.js:25683:10) at Player.basicPluginWrapper [as qualityLevels] (video.es.js:24440:29) at VhsHandler.setupQualityLevels_ (video.es.js:48995:34) at VhsHandler.src (video.es.js:48889:10) at Object.handleSource (video.es.js:49119:14) at Tech.setSource (video.es.js:8956:30) at new Html5 (video.es.js:17509:12) at Player.loadTech (video.es.js:20456:18)

What version of Video.js are you using?

8.0.2

Video.js plugins used.

"@types/video.js": "^7.3.50"

What browser(s) including version(s) does this occur with?

chrome 108.0.5359.98

What OS(es) and version(s) does this occur with?

win10

welcome[bot] commented 1 year ago

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

mister-ben commented 1 year ago

Not sure what the "qualityLevels2" plugin mentioned is, but Video.js 8 does include a qualityLevels plugin. "Class constructor ... cannot be invoked without 'new'" errors will occur in Video.js 8 if transpiled classes are used in plugins or elsewhere, they must be native ES6 classes.

It looks like the default es build does have transpiled classes though, so that need to be changed.

chenbing11 commented 1 year ago

Video.js v8. The video format suffix is ​​mp4 and the result is normal, but the m3u8 video reports an error. The framework used by the project is vue3.2+vite2, and the writing method is also the official reference demo image