Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native ES6 class support #112

Open
Shreyas-sonu opened this issue May 16, 2024 · 2 comments
Open

native ES6 class support #112

Shreyas-sonu opened this issue May 16, 2024 · 2 comments

Comments

@Shreyas-sonu
Copy link

TypeError: Class constructor Plugin cannot be invoked without 'new' means the plugin class has been transpiled and
that won't work, it has to be a native ES6 class. please add support

@PauloMendees
Copy link

PauloMendees commented Aug 8, 2024

Same error here, do you find the solution?

@piscis
Copy link

piscis commented Dec 2, 2024

So i had the same problem with in a vite + vue3 project migrating from VideoJS 7 to VideoJS 8. It seems that importing via the default import does not work but importing the src and transpile it with your vite build does.

So instead of:

import 'videojs-hls-quality-selector'

do this and import from source

import 'videojs-hls-quality-selector/src/plugin'

then register the plugin options when player is ready

const player = videojs(videoPlayer.value, options)
    player.ready(() => {
      if(player.hlsQualitySelector) {
        player.hlsQualitySelector({
          displayCurrentQuality: true,
        })
      }
    })

seams to work afaik.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants