bigscreen-player
Advanced tools
Comparing version 2.2.0 to 2.2.1
{ | ||
"name": "bigscreen-player", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Simplified media playback for bigscreen devices.", | ||
@@ -5,0 +5,0 @@ "main": "script/bigscreenplayer.js", |
@@ -5,5 +5,6 @@ require( | ||
'bigscreenplayer/models/mediakinds', | ||
'bigscreenplayer/models/windowtypes' | ||
'bigscreenplayer/models/windowtypes', | ||
'bigscreenplayer/pluginenums' | ||
], | ||
function (Squire, MediaKinds, WindowTypes) { | ||
function (Squire, MediaKinds, WindowTypes, PluginEnums) { | ||
describe('Media Source Extensions Playback Strategy', function () { | ||
@@ -717,3 +718,62 @@ var injector = new Squire(); | ||
}); | ||
describe('dashJS CDN_FAILOVER event', function () { | ||
var errorProperties = { | ||
seekable_range: '0 to 101', | ||
current_time: 0, | ||
duration: 101, | ||
error_mssg: 'download' | ||
}; | ||
var pluginData = { | ||
status: PluginEnums.STATUS.FAILOVER, | ||
stateType: PluginEnums.TYPE.ERROR, | ||
properties: errorProperties, | ||
isBufferingTimeoutError: false, | ||
cdn: 'cdn1', | ||
isInitialPlay: undefined, | ||
timeStamp: jasmine.any(Object) | ||
}; | ||
beforeEach(function () { | ||
mockPluginsInterface.onErrorHandled.calls.reset(); | ||
}); | ||
it('should not fire error handled event on initial load', function () { | ||
var mockEvent = { | ||
mediaType: 'video', | ||
type: 'baseUrlSelected', | ||
baseUrl: { | ||
serviceLocation: 'cdn1' | ||
} | ||
}; | ||
setUpMSE(); | ||
mseStrategy.load(cdnArray, null, 0); | ||
dashEventCallback(dashjsMediaPlayerEvents.CDN_FAILOVER, mockEvent); | ||
expect(mockPluginsInterface.onErrorHandled).not.toHaveBeenCalled(); | ||
}); | ||
it('should fire an error handled event on the plugins with the erroring CDN', function () { | ||
var mockEvent = { | ||
mediaType: 'video', | ||
type: 'baseUrlSelected', | ||
baseUrl: { | ||
serviceLocation: 'cdn2' | ||
} | ||
}; | ||
setUpMSE(); | ||
cdnArray.push({url: 'testcdn2/test/', cdn: 'cdn2'}); | ||
mseStrategy.load(cdnArray, null, 0); | ||
dashEventCallback(dashjsMediaPlayerEvents.CDN_FAILOVER, mockEvent); | ||
expect(mockPluginsInterface.onErrorHandled).toHaveBeenCalledWith(jasmine.objectContaining(pluginData)); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -1113,3 +1113,3 @@ require( | ||
isBufferingTimeoutError: false, | ||
cdn: 'cdn-b', | ||
cdn: 'cdn-a', | ||
isInitialPlay: undefined, | ||
@@ -1116,0 +1116,0 @@ timeStamp: jasmine.any(Object) |
@@ -35,3 +35,2 @@ define('bigscreenplayer/playbackstrategy/msestrategy', | ||
var mediaSources; | ||
var cdns; | ||
@@ -167,8 +166,8 @@ var playerMetadata = { | ||
isBufferingTimeoutError: false, | ||
cdn: cdn | ||
cdn: mediaSources[0].cdn | ||
}); | ||
// urls -> sources -> mediaSources (shift the cdns for correct behaviour with buffering timeout failover) | ||
// TODO: Remove this horrible mutation when failover is pushed down per strategy. | ||
Plugins.interface.onErrorHandled(evt); | ||
mediaSources.shift(); | ||
Plugins.interface.onErrorHandled(evt); | ||
cdnDebugOutput.update(); | ||
@@ -180,12 +179,2 @@ } | ||
var cdn; | ||
if (event.baseUrl.url) { | ||
cdns.forEach(function (element) { | ||
if (event.baseUrl.serviceLocation === element) { | ||
cdn = element; | ||
} | ||
}); | ||
} | ||
var pluginEvent = { | ||
@@ -197,3 +186,3 @@ errorProperties: { | ||
propagateCdnFailover(pluginEvent, cdn); | ||
propagateCdnFailover(pluginEvent, event.baseUrl.serviceLocation); | ||
} | ||
@@ -284,6 +273,2 @@ | ||
cdns = sources.map(function (source) { | ||
return source.cdn; | ||
}); | ||
if (windowType !== WindowTypes.GROWING) { | ||
@@ -464,3 +449,2 @@ var baseUrls = sources.map(function (source, priority) { | ||
dashMetrics = undefined; | ||
cdns = undefined; | ||
mediaSources = undefined; | ||
@@ -467,0 +451,0 @@ }, |
@@ -265,5 +265,5 @@ define( | ||
function cdnFailover (failoverTime, thenPause, errorProperties, bufferingTimeoutError) { | ||
mediaMetaData.urls.shift(); | ||
var evt = new PluginData({ status: PluginEnums.STATUS.FAILOVER, stateType: PluginEnums.TYPE.ERROR, properties: errorProperties, isBufferingTimeoutError: bufferingTimeoutError, cdn: mediaMetaData.urls[0].cdn }); | ||
Plugins.interface.onErrorHandled(evt); | ||
mediaMetaData.urls.shift(); | ||
cdnDebugOutput.update(); | ||
@@ -270,0 +270,0 @@ loadMedia(mediaMetaData.urls, mediaMetaData.type, failoverTime, thenPause); |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
7548020
95
71863