Fix Firefox YouTube default Flash mode

BLD-895
This commit is contained in:
Valera Rozuvan
2014-03-06 18:36:33 +02:00
parent c85905d648
commit cf47f522c0
2 changed files with 22 additions and 1 deletions

View File

@@ -183,6 +183,25 @@ function (VideoPlayer) {
});
});
describe('onReady YouTube', function () {
beforeEach(function () {
state = jasmine.initializePlayerYouTube();
state.videoEl = $('video, iframe');
});
it('multiple speeds and flash mode, change back to html5 mode', function () {
var playbackRates = state.videoPlayer.player.getAvailablePlaybackRates();
state.currentPlayerMode = 'flash';
state.videoPlayer.onReady();
expect(playbackRates.length).toBe(4);
expect(state.currentPlayerMode).toBe('html5');
});
});
describe('onStateChange', function () {
describe('when the video is unstarted', function () {
beforeEach(function () {

View File

@@ -559,7 +559,7 @@ function (HTML5Video, Resizer) {
);
if (
this.currentPlayerMode === 'html5' &&
(this.currentPlayerMode === 'html5' || availablePlaybackRates.length > 1) &&
this.videoType === 'youtube'
) {
if (availablePlaybackRates.length === 1 && !this.isTouch) {
@@ -573,6 +573,8 @@ function (HTML5Video, Resizer) {
_restartUsingFlash(this);
} else if (availablePlaybackRates.length > 1) {
this.currentPlayerMode = 'html5';
// We need to synchronize available frame rates with the ones
// that the user specified.