videojs-resolution-switcher icon indicating copy to clipboard operation
videojs-resolution-switcher copied to clipboard

Not Switching source with flash

Open tahirawan4 opened this issue 9 years ago • 12 comments

This plugin does not from techtype=Flash.

tahirawan4 avatar Sep 30 '15 12:09 tahirawan4

Yes, I have the same problem. I will try fix it soon.

kmoskwiak avatar Oct 01 '15 12:10 kmoskwiak

I figured out the solution, Now it does work :)

tahirawan4 avatar Oct 03 '15 11:10 tahirawan4

cool! what did you do?

kmoskwiak avatar Oct 03 '15 12:10 kmoskwiak

Hello, I'm also very interested by the answer. (beside that small inconvenience, resolution-switcher and video.js 5 are great!)

stephanepoinsart avatar Oct 16 '15 10:10 stephanepoinsart

Latest version should fix the problem. According to this setting preload="auto" is required.

kmoskwiak avatar Oct 17 '15 23:10 kmoskwiak

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.

stephanepoinsart avatar Oct 19 '15 14:10 stephanepoinsart

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.

stephanepoinsart avatar Oct 19 '15 17:10 stephanepoinsart

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);
  });
}

tahirawan4 avatar Oct 20 '15 07:10 tahirawan4

Thanks for that. I will test it soon.

kmoskwiak avatar Oct 20 '15 20:10 kmoskwiak

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 :(

kmoskwiak avatar Oct 28 '15 15:10 kmoskwiak

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(); }

cucygh avatar Jul 20 '16 08:07 cucygh

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);

zhouhong avatar Jan 18 '18 09:01 zhouhong