videojs-resolution-switcher
videojs-resolution-switcher copied to clipboard
Not Switching source with flash
This plugin does not from techtype=Flash.
Yes, I have the same problem. I will try fix it soon.
I figured out the solution, Now it does work :)
cool! what did you do?
Hello, I'm also very interested by the answer. (beside that small inconvenience, resolution-switcher and video.js 5 are great!)
Latest version should fix the problem. According to this setting preload="auto"
is required.
Hello, I tried the new version. It improved the situation : if I switch resolution while playing, the playback continue correctly in the new resolution, that's some use. But, I still have the following problems :
- While the video is correctly played after the resolution is switched, the progressbar stop "progressing", and the time stay frozen to when i changed the resolution.
- If I pause and then I switch the resolution, the playback stay in a "frozen state" : the progress bar does not show up on hover, and then, there is the "circle" progress indicator that stay on forever (like if the video was loading). I can clic on the background of the video and then it continues playing but the "loading" indicator stays on. If i seek in the video after that, the loading indicator disappear and the playback resume correctly.
I tried to experiment a bit (testing changes to the onClick function), it looks like events are not firing as they should for the flash tech, and even if we do without them (because we don’t really need them) and just run commands, the GUI explode. That or I don’t understand how to use it correctly.
So far I can work around most problems except the progressbar not updating, using this quite sick sequence in setSourcesSanitized :
this.player_.play().handleTechSeeked_();
this.player_.pause();
this.player_.currentTime(currentTime);
this.player_.play().handleTechSeeked_();
I'm not going to use that, I will just see if I can disable resolution switching for the flash tech in my use case. Legacy browsers can stay low res.
You have to load tech in case of flash, Here is the fix Add following code in onclick
if(this.player_.techName_ == "Flash"){
var source = '';
//select source to load because this.player_.loadTech_ will take only one source
for (var i = 0, l = this.src.length; i < l; i++) {
//select source with flash url
if(this.src[i].type == 'rtmp/mp4'){
source = {src:this.src[i].src,type:this.src[i].type};
break;
}
}
this.player_.loadTech_(this.player_.techName_,source);
if(!isPaused){ this.player_.play(); }
this.player_.one('loadeddata', function(){
this.player_.currentTime(currentTime);
});
}
Thanks for that. I will test it soon.
player_.loadTech_ does not fix issue. I've tested it, but nothing changed.
I've fixed the "frozen state" when video was paused by adding handleTechSeeked_(), but progress bar still does not update :(
I get the same issue in ie8, I fix the code in "onClick" at the last withif (this.player_.techName_ == 'Flash' && this.player_.paused() && isIE8) { this.player_.play(); }
I found the solution, just change to current time + 1, setSourcesSanitized(this.player_, this.src, this.options_.label, customSourcePicker).one(handleSeekEvent, function() { this.player_.currentTime(currentTime+1);