videojs-resolution-switcher
videojs-resolution-switcher copied to clipboard
Not work on iOS
Hi, The resolution button is displayed on iOS, but the player stops when switching source. (tested on demo page https://kmoskwiak.github.io/videojs-resolution-switcher/ )
Hello, definitely resolution button has a problem with iOS which have been described by @alobimday. Can you provide some solution?
I am having the same problem. When switching stream in iOS the playback stops. Did someone came up with a solution?
I will look into this
+1
Anything new in this regard? We are considering to implement your solution for our church video archive but iOS support is a must in our case.
Hi @kmoskwiak any update on this please?
does still not support IOS?
In the player.currentResolution function find these lines:
// Change player source and wait for loadeddata event, then play video
// loadedmetadata doesn't work right now for flash.
// Probably because of https://github.com/videojs/video-js-swf/issues/124
// If player preload is 'none' and then loadeddata not fired. So, we need timeupdate event for seek handle (timeupdate doesn't work properly with flash)
var handleSeekEvent = 'loadeddata';
if (this.player_.techName_ !== 'Youtube' && this.player_.preload() === 'none' && this.player_.techName_ !== 'Flash') {
handleSeekEvent = 'timeupdate';
}
player.setSourcesSanitized(sources, label, customSourcePicker || settings.customSourcePicker);
player.one(handleSeekEvent, function () {
player.currentTime(currentTime);
player.handleTechSeeked_();
if (!isPaused) {
// Start playing and hide loadingSpinner (flash issue ?)
player.play().handleTechSeeked_();
}
player.trigger('resolutionchange');
});
And delete and replace it with:
player.setSourcesSanitized(sources, label, customSourcePicker || settings.customSourcePicker);
player.one('loadedmetadata', function () {
player.currentTime(currentTime);
player.handleTechSeeked_();
if (!isPaused) {
// Start playing and hide loadingSpinner (flash issue ?)
player.play().handleTechSeeked_();
}
player.trigger('resolutionchange');
});
Basically bypass all the logic it was doing and just use the 'loadedmetadata' event that the comment says flash has a problem with.