bigscreen-player
Advanced tools
Comparing version 2.8.0 to 2.9.0
{ | ||
"name": "bigscreen-player", | ||
"version": "2.8.0", | ||
"version": "2.9.0", | ||
"description": "Simplified media playback for bigscreen devices.", | ||
@@ -5,0 +5,0 @@ "main": "script/bigscreenplayer.js", |
@@ -45,3 +45,3 @@ require( | ||
expect(MediaResilience.shouldFailover(2, 100, 10, LiveSupport.SEEKABLE, WindowTypes.GROWING, TransferFormats.HLS)).toBe(true); | ||
expect(MediaResilience.shouldFailover(2, 100, 10, LiveSupport.RESTARTABLE, WindowTypes.GROWING, TransferFormats.HLS)).toBe(false); | ||
expect(MediaResilience.shouldFailover(2, 100, 10, LiveSupport.RESTARTABLE, WindowTypes.GROWING, TransferFormats.HLS)).toBe(true); | ||
expect(MediaResilience.shouldFailover(2, 100, 10, LiveSupport.PLAYABLE, WindowTypes.GROWING, TransferFormats.HLS)).toBe(true); | ||
@@ -64,3 +64,3 @@ }); | ||
expect(MediaResilience.shouldFailover(2, 100, 10, LiveSupport.SEEKABLE, WindowTypes.SLIDING, TransferFormats.HLS)).toBe(true); | ||
expect(MediaResilience.shouldFailover(2, 100, 10, LiveSupport.RESTARTABLE, WindowTypes.SLIDING, TransferFormats.HLS)).toBe(false); | ||
expect(MediaResilience.shouldFailover(2, 100, 10, LiveSupport.RESTARTABLE, WindowTypes.SLIDING, TransferFormats.HLS)).toBe(true); | ||
expect(MediaResilience.shouldFailover(2, 100, 10, LiveSupport.PLAYABLE, WindowTypes.SLIDING, TransferFormats.HLS)).toBe(true); | ||
@@ -67,0 +67,0 @@ }); |
@@ -25,3 +25,3 @@ require( | ||
it('Causes MSE Strategy to be picked if there are no configured exceptions', function () { | ||
expect(StrategyPicker(WindowTypes.STATIC, !isUHD)).toBe('mseStrategy'); | ||
expect(StrategyPicker(WindowTypes.STATIC, !isUHD)).toBe('msestrategy'); | ||
}); | ||
@@ -32,3 +32,3 @@ | ||
expect(StrategyPicker(WindowTypes.STATIC, isUHD)).toBe('talStrategy'); | ||
expect(StrategyPicker(WindowTypes.STATIC, isUHD)).toBe('nativestrategy'); | ||
}); | ||
@@ -39,3 +39,3 @@ | ||
expect(StrategyPicker(WindowTypes.STATIC, !isUHD)).toBe('mseStrategy'); | ||
expect(StrategyPicker(WindowTypes.STATIC, !isUHD)).toBe('msestrategy'); | ||
}); | ||
@@ -47,3 +47,3 @@ | ||
expect(StrategyPicker(WindowTypes.STATIC, !isUHD)).toBe('mseStrategy'); | ||
expect(StrategyPicker(WindowTypes.STATIC, !isUHD)).toBe('msestrategy'); | ||
}); | ||
@@ -54,3 +54,3 @@ | ||
expect(StrategyPicker(WindowTypes.STATIC, !isUHD)).toBe('talStrategy'); | ||
expect(StrategyPicker(WindowTypes.STATIC, !isUHD)).toBe('nativestrategy'); | ||
}); | ||
@@ -61,3 +61,3 @@ | ||
expect(StrategyPicker(WindowTypes.SLIDING, !isUHD)).toBe('mseStrategy'); | ||
expect(StrategyPicker(WindowTypes.SLIDING, !isUHD)).toBe('msestrategy'); | ||
}); | ||
@@ -68,3 +68,3 @@ | ||
expect(StrategyPicker(WindowTypes.SLIDING, !isUHD)).toBe('talStrategy'); | ||
expect(StrategyPicker(WindowTypes.SLIDING, !isUHD)).toBe('nativestrategy'); | ||
}); | ||
@@ -75,3 +75,3 @@ | ||
expect(StrategyPicker(WindowTypes.GROWING, !isUHD)).toBe('mseStrategy'); | ||
expect(StrategyPicker(WindowTypes.GROWING, !isUHD)).toBe('msestrategy'); | ||
}); | ||
@@ -82,3 +82,3 @@ | ||
expect(StrategyPicker(WindowTypes.GROWING, !isUHD)).toBe('talStrategy'); | ||
expect(StrategyPicker(WindowTypes.GROWING, !isUHD)).toBe('nativestrategy'); | ||
}); | ||
@@ -85,0 +85,0 @@ }); |
@@ -888,2 +888,3 @@ require( | ||
var currentTimeSpy; | ||
var currentStrategy; | ||
@@ -916,5 +917,7 @@ beforeEach(function () { | ||
spyOn(mockStrategy, 'getSeekableRange').and.returnValue({start: 0, end: 100}); | ||
currentStrategy = window.bigscreenPlayer.playbackStrategy; | ||
}); | ||
afterEach(function () { | ||
window.bigscreenPlayer.playbackStrategy = currentStrategy; | ||
jasmine.clock().uninstall(); | ||
@@ -1012,2 +1015,3 @@ }); | ||
it('should publish a media state update of fatal when failover is disabled', function () { | ||
window.bigscreenPlayer.playbackStrategy = 'talstrategy'; | ||
liveSupport = LiveSupport.RESTARTABLE; | ||
@@ -1014,0 +1018,0 @@ setUpPlayerComponent({multiCdn: true, transferFormat: TransferFormats.HLS, windowType: WindowTypes.GROWING}); |
define( | ||
'bigscreenplayer/mediaresilience', [ | ||
'bigscreenplayer/models/windowtypes', | ||
'bigscreenplayer/models/livesupport', | ||
'bigscreenplayer/models/transferformats' | ||
'bigscreenplayer/models/playbackstrategy' | ||
], | ||
function (WindowTypes, LiveSupport, TransferFormats) { | ||
function (WindowTypes, PlaybackStrategy) { | ||
'use strict'; | ||
@@ -13,3 +12,3 @@ | ||
var shouldStaticFailover = windowType === WindowTypes.STATIC && !aboutToEnd; | ||
var shouldLiveFailover = windowType !== WindowTypes.STATIC && (transferFormat === TransferFormats.DASH || liveSupport !== LiveSupport.RESTARTABLE); | ||
var shouldLiveFailover = windowType !== WindowTypes.STATIC && window.bigscreenPlayer.playbackStrategy !== PlaybackStrategy.TAL && !window.bigscreenPlayer.disableLiveFailover; | ||
return remainingUrls > 1 && (shouldStaticFailover || shouldLiveFailover); | ||
@@ -16,0 +15,0 @@ } |
@@ -6,9 +6,10 @@ define('bigscreenplayer/playbackstrategy/hybridstrategy', | ||
'bigscreenplayer/playbackstrategy/strategypicker', | ||
'bigscreenplayer/models/livesupport' | ||
'bigscreenplayer/models/livesupport', | ||
'bigscreenplayer/models/playbackstrategy' | ||
], | ||
function (Native, MSE, StrategyPicker, LiveSupport) { | ||
function (Native, MSE, StrategyPicker, LiveSupport, PlaybackStrategy) { | ||
var HybridStrategy = function (windowType, mediaKind, timeCorrection, videoElement, isUHD, device, cdnDebugOutput) { | ||
var strategy = StrategyPicker(windowType, isUHD); | ||
if (strategy === 'mseStrategy') { | ||
if (strategy === PlaybackStrategy.MSE) { | ||
return MSE(windowType, mediaKind, timeCorrection, videoElement, isUHD, device, cdnDebugOutput); | ||
@@ -15,0 +16,0 @@ } |
@@ -15,2 +15,3 @@ define( | ||
var fakeTimer = {}; | ||
var timeCorrection = timeData.correction || 0; | ||
addEventCallback(this, updateFakeTimer); | ||
@@ -66,3 +67,3 @@ | ||
function getCurrentTime () { | ||
return fakeTimer.currentTime; | ||
return fakeTimer.currentTime + timeCorrection; | ||
} | ||
@@ -74,4 +75,4 @@ | ||
return { | ||
start: windowType === WindowTypes.SLIDING ? delta : 0, | ||
end: windowLength + delta | ||
start: (windowType === WindowTypes.SLIDING ? delta : 0) + timeCorrection, | ||
end: windowLength + delta + timeCorrection | ||
}; | ||
@@ -78,0 +79,0 @@ } |
define('bigscreenplayer/playbackstrategy/strategypicker', | ||
function () { | ||
[ | ||
'bigscreenplayer/models/playbackstrategy' | ||
], | ||
function (PlaybackStrategy) { | ||
return function (windowType, isUHD) { | ||
var strategy = 'mseStrategy'; | ||
var mseExceptions = window.bigscreenPlayer.mseExceptions || []; | ||
if (mseExceptions.indexOf(windowType) !== -1) { | ||
strategy = 'talStrategy'; | ||
return PlaybackStrategy.NATIVE; | ||
} | ||
if (isUHD && mseExceptions.indexOf('uhd') !== -1) { | ||
strategy = 'talStrategy'; | ||
return PlaybackStrategy.NATIVE; | ||
} | ||
return strategy; | ||
return PlaybackStrategy.MSE; | ||
}; | ||
} | ||
); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7413218
67052