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

Selector occasionally won't switch qualities #70

Closed
bman46 opened this issue Feb 18, 2021 · 7 comments
Closed

Selector occasionally won't switch qualities #70

bman46 opened this issue Feb 18, 2021 · 7 comments

Comments

@bman46
Copy link

bman46 commented Feb 18, 2021

Description

When attempting to switch qualities, the selector will occasionally refuse to change the video source to the new quality. The quality selected by the user remains selected in the menu however the player never switches to the new quality. No errors are thrown in the console when this happens.
I have tried this on my windows 10 desktop PC and my Mac in chrome both have this issue.

Steps to reproduce

This issue appears to happen 'randomly' although it occurs more often than not.

  1. Open this codepen in Chrome.
  2. Play the video
  3. Change qualities using the cog
  4. If it succeeds, refresh the page and try again - sometime it works sometimes it doesn't.
  5. if it fails, refresh the page and try again.

Results

Expected:
The video will change qualities as indicated by the player buffering and the network stream showing the traffic from a new source.
Actual:
The video player may or may not change the video quality.
Errors:
No errors are shown in the console.

Additional Information

The codepen above uses VideoJS version 6.1.0 but I have tested it in my own application with VideoJS version 7.10.2.
Chrome version: 88.0.4324.182

@bman46
Copy link
Author

bman46 commented Feb 18, 2021

Here is a video recording of the issue: Youtube Video

@EdoardoLopez
Copy link

EdoardoLopez commented Feb 24, 2021

I have the same issue.
i tried with this versions:

  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.0

and not worked.

@mootunes
Copy link

I'm also having this issue.

@izkmdz
Copy link
Contributor

izkmdz commented Feb 21, 2022

Thank you for your help in documenting this issue. It seems to be occurring when the video player is initialized twice.

Try removing the data-setup=“{}” property from your video component and initalizing the video player with:

videojs("video_1", {}, function() {
   var player = this;
   player.controlBar.addChild('QualitySelector');
});

@bman46
Copy link
Author

bman46 commented Feb 22, 2022

@izkmdz Is there an alternative option instead of removing data-setup? I use that for other settings as well and cant remove it.

@izkmdz
Copy link
Contributor

izkmdz commented Feb 22, 2022

Hello @bman46, the issue seems to happen when using both data-setup and videojs('my-player') to initialize the video player twice. You should still be able to pass in properties to the videojs() function as you would do with data-setup.

For example,

data-setup='{"fluid": true, "controls": true}'

will accomplish the same as

var options = {
   fluid: true, 
   controls: true
};

videojs("video_1", options, function() {
   var player = this;
   player.controlBar.addChild('QualitySelector');
});

Alternatively, you can still use the data-setup attribute without the side effects of calling videojs(). Please see the videoJS documentation for ways to access the reference to the initialized video player which you can then use to call player.controlBar.addChild('QualitySelector');.

https://docs.videojs.com/tutorial-setup.html

Thanks!

@bman46
Copy link
Author

bman46 commented Feb 22, 2022

Ok, thanks for your help @izkmdz. That resolves the issue!

@bman46 bman46 closed this as completed Feb 22, 2022
izkmdz added a commit to izkmdz/videojs-quality-selector that referenced this issue Feb 23, 2022
izkmdz added a commit to izkmdz/videojs-quality-selector that referenced this issue Feb 28, 2022
yokuze added a commit that referenced this issue Apr 4, 2022
docs: Remove data-setup property to prevent double initialization (#70)
pbredenberg pushed a commit to pbredenberg/videojs-quality-selector that referenced this issue Jul 8, 2022
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

4 participants