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

Not work on iOS

Open ghost opened this issue 9 years ago • 7 comments

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

ghost avatar Apr 07 '16 08:04 ghost

Hello, definitely resolution button has a problem with iOS which have been described by @alobimday. Can you provide some solution?

djordjevic avatar May 04 '16 11:05 djordjevic

I am having the same problem. When switching stream in iOS the playback stops. Did someone came up with a solution?

daviking1 avatar May 05 '16 15:05 daviking1

I will look into this

kmoskwiak avatar May 05 '16 16:05 kmoskwiak

+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.

JanSichula avatar Aug 22 '16 11:08 JanSichula

Hi @kmoskwiak any update on this please?

paladox avatar Sep 24 '16 11:09 paladox

does still not support IOS?

ajahongir avatar Oct 12 '16 08:10 ajahongir

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.

DerekZiemba avatar Jan 11 '17 20:01 DerekZiemba