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

TypeError: this.videoPlayer.httpSourceSelector is not a function #7144

Closed
KVPasupuleti opened this issue Mar 23, 2021 · 4 comments · Fixed by #7263
Closed

TypeError: this.videoPlayer.httpSourceSelector is not a function #7144

KVPasupuleti opened this issue Mar 23, 2021 · 4 comments · Fixed by #7263

Comments

@KVPasupuleti
Copy link
Contributor

KVPasupuleti commented Mar 23, 2021

Description

We are using videojs-http-source-selector plugin in our project for 2 years and it's working well. Now, we would like to extend its support to our other projects.

But, when tried to replicate the entire videojs related code to the new project, everything went well except for this httpSourceSelector error. This would be a blocker for us to make the feature live.

Could you help us out with what might have gone wrong or any additional details to take care of?

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. Install video-js-http-source-selector in package.json using yarn
  2. Import it using require in the Video component developed using React and TypeScript
  3. Add videojs-contrib-quality-levels as a peer dependancy
  4. Initialize the plugin with this.videoPlayer.httpSourceSelector().
  5. Use //@ts-ignore above the initialization to ignore typescript errors

image

Results

Expected

videojs-http-source-selector plugin should be initialized and the user should be able to see the quality change option

Actual

videojs-http-source-selector is not getting initialized

Error output

TypeError: this.videoPlayer.httpSourceSelector is not a function

Additional Information

Please include any additional information necessary here. Including the following:

versions

videojs

7.6.6

typescript

3.7.2

browsers

Chrome 89

OSes

Linux

plugins

videojs-contrib-quality-levels

2.0.9

videojs-http-source-selector

1.1.6

@gkatsev
Copy link
Member

gkatsev commented Mar 23, 2021

This sort of came up in #7091. One thing to try is to remove video.js and quality-levels and the source selector plugins via yarn remove. Verify that the yarn lockfile does not include these anymore. Then, re-add the packages starting with video.js and then the source selector and quality-levels. Hopefully, it'll shake up the tree, so things are correct.

We'll be investigating this as part of #7091 and #7109 so that hopefully it won't be required.

@KVPasupuleti
Copy link
Contributor Author

KVPasupuleti commented Mar 26, 2021

This sort of came up in #7091. One thing to try is to remove video.js and quality-levels and the source selector plugins via yarn remove. Verify that the yarn lockfile does not include these anymore. Then, re-add the packages starting with video.js and then the source selector and quality-levels. Hopefully, it'll shake up the tree, so things are correct.

We'll be investigating this as part of #7091 and #7109 so that hopefully it won't be required.

@gkatsev Thanks for the reply. Tried out the process you suggested, but the issue wasn't resolved.

We are using Yarn.

But, when we removed all video-js related packages and reinstalled them using NPM, the issue was resolved.

Any specific reason?

@gkatsev
Copy link
Member

gkatsev commented Mar 26, 2021

I'm not really too sure. What version of yarn are you using?
I'm guessing that somehow the dependency tree that's being made by npm vs yarn is different and so plugins end up using their own version of Video.js since plugins depend on Video.js directly rather than having it be a peer dependency.

@KVPasupuleti
Copy link
Contributor Author

KVPasupuleti commented Mar 27, 2021

"engines": {
      "npm": ">=5.6.0",
      "yarn": ">=1.17.3",
      "node": ">=12.6.0"
 }

So, is it mandatory to use the latest version of Video-js to avoid these kinds of issues?

gkatsev added a commit that referenced this issue Jun 7, 2021
gkatsev added a commit that referenced this issue Jun 7, 2021
Because VHS is inlined into Video.js, we should depend on what VHS
depends on.

Fixes #7091, fixes #7209, fixes #7144, fixes #7109
gkatsev added a commit that referenced this issue Jun 8, 2021
Because VHS is inlined into Video.js, we should depend on what VHS
depends on.

Fixes #7091, fixes #7209, fixes #7144, fixes #7109
kernicPanel added a commit to openfun/marsha that referenced this issue Aug 4, 2021
According to videojs/video.js#7144,
video.js needed a reinstall, in order to remove old dependencies.
kernicPanel added a commit to openfun/marsha that referenced this issue Aug 4, 2021
According to videojs/video.js#7144,
video.js needed a reinstall, in order to remove old dependencies.
lunika added a commit to openfun/marsha that referenced this issue Sep 20, 2021
According to videojs/video.js#7144,
video.js needed a reinstall, in order to remove old dependencies.
lunika added a commit to openfun/marsha that referenced this issue Sep 20, 2021
According to videojs/video.js#7144,
video.js needed a reinstall, in order to remove old dependencies.
kernicPanel added a commit to openfun/marsha that referenced this issue Nov 22, 2021
video.js needed a reinstall, in order to remove old dependencies.
Probaly the same problem as in videojs/video.js#7144,
kernicPanel added a commit to openfun/marsha that referenced this issue Nov 22, 2021
video.js needed a reinstall, in order to remove old dependencies.
Probaly the same problem as in videojs/video.js#7144,
kernicPanel added a commit to openfun/marsha that referenced this issue Nov 22, 2021
video.js needed a reinstall, in order to remove old dependencies.
Probaly the same problem as in videojs/video.js#7144,
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2022
edirub pushed a commit to edirub/video.js that referenced this issue Jun 8, 2023
Because VHS is inlined into Video.js, we should depend on what VHS
depends on.

Fixes videojs#7091, fixes videojs#7209, fixes videojs#7144, fixes videojs#7109
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants