bigscreen-player
Advanced tools
Comparing version 2.7.0 to 2.7.1
{ | ||
"name": "bigscreen-player", | ||
"version": "2.7.0", | ||
"version": "2.7.1", | ||
"description": "Simplified media playback for bigscreen devices.", | ||
@@ -5,0 +5,0 @@ "main": "script/bigscreenplayer.js", |
@@ -16,18 +16,27 @@ require( | ||
contentType: 'video', | ||
mimeType: 'video/mp4', | ||
Representation_asArray: [ | ||
{ | ||
bandwidth: 438000, | ||
frameRate: 25 | ||
frameRate: 25, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 827000, | ||
frameRate: 30 | ||
frameRate: 30, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 1570000, | ||
frameRate: 50 | ||
frameRate: 50, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 2812000, | ||
frameRate: 50 | ||
frameRate: 50, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
} | ||
@@ -61,10 +70,15 @@ ] | ||
contentType: 'video', | ||
mimeType: 'video/mp4', | ||
Representation_asArray: [ | ||
{ | ||
bandwidth: 438000, | ||
frameRate: 25 | ||
frameRate: 25, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 827000, | ||
frameRate: 30 | ||
frameRate: 30, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
} | ||
@@ -95,10 +109,15 @@ ] | ||
contentType: 'video', | ||
mimeType: 'video/mp4', | ||
Representation_asArray: [ | ||
{ | ||
bandwidth: 1570000, | ||
frameRate: 50 | ||
frameRate: 50, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 2812000, | ||
frameRate: 50 | ||
frameRate: 50, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
} | ||
@@ -129,6 +148,9 @@ ] | ||
contentType: 'video', | ||
mimeType: 'video/mp4', | ||
Representation_asArray: [ | ||
{ | ||
bandwidth: 827000, | ||
frameRate: 30 | ||
frameRate: 30, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
} | ||
@@ -159,2 +181,3 @@ ] | ||
contentType: 'video', | ||
mimeType: 'video/mp4', | ||
Representation_asArray: [] | ||
@@ -177,2 +200,104 @@ }, | ||
}); | ||
it('should convert all avc3 codec representations to avc1 when the flag is enabled', function () { | ||
var expectedManifest = { | ||
Period: { | ||
AdaptationSet: [ | ||
{ | ||
contentType: 'video', | ||
mimeType: 'video/mp4', | ||
Representation_asArray: [ | ||
{ | ||
bandwidth: 438000, | ||
frameRate: 25, | ||
codecs: 'avc1.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 827000, | ||
frameRate: 30, | ||
codecs: 'avc1.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 1570000, | ||
frameRate: 50, | ||
codecs: 'avc1.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 2812000, | ||
frameRate: 50, | ||
codecs: 'avc1.4D401E', | ||
mimeType: 'video/mp4' | ||
} | ||
] | ||
}, | ||
{ | ||
contentType: 'audio', | ||
Representation_asArray: [ | ||
{ | ||
bandwidth: 128000 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}; | ||
var actualManifest = ManifestModifier.filter(manifest, {}, true); | ||
expect(actualManifest).toEqual(expectedManifest); | ||
}); | ||
it('should not affect avc3 codec representations the old codec flag is not present', function () { | ||
var expectedManifest = { | ||
Period: { | ||
AdaptationSet: [ | ||
{ | ||
contentType: 'video', | ||
mimeType: 'video/mp4', | ||
Representation_asArray: [ | ||
{ | ||
bandwidth: 438000, | ||
frameRate: 25, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 827000, | ||
frameRate: 30, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 1570000, | ||
frameRate: 50, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
}, | ||
{ | ||
bandwidth: 2812000, | ||
frameRate: 50, | ||
codecs: 'avc3.4D401E', | ||
mimeType: 'video/mp4' | ||
} | ||
] | ||
}, | ||
{ | ||
contentType: 'audio', | ||
Representation_asArray: [ | ||
{ | ||
bandwidth: 128000 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}; | ||
var actualManifest = ManifestModifier.filter(manifest, {}, undefined); | ||
expect(actualManifest).toEqual(expectedManifest); | ||
}); | ||
}); | ||
@@ -179,0 +304,0 @@ |
define('bigscreenplayer/manifest/manifestmodifier', | ||
function () { | ||
[ | ||
'bigscreenplayer/debugger/debugtool' | ||
], | ||
function (DebugTool) { | ||
'use strict'; | ||
function filter (manifest, representationOptions) { | ||
function filter (manifest, representationOptions, oldDashCodecRequired) { | ||
var constantFps = representationOptions.constantFps; | ||
@@ -26,2 +29,10 @@ var maxFps = representationOptions.maxFps; | ||
} | ||
if (oldDashCodecRequired) { | ||
DebugTool.keyValue({ key: 'Video Container', value: 'avc1' }); | ||
manifest = rewriteDashCodec(manifest); | ||
} else { | ||
DebugTool.keyValue({ key: 'Video Container', value: 'avc3' }); | ||
} | ||
return manifest; | ||
@@ -52,2 +63,25 @@ } | ||
function rewriteDashCodec (manifest) { | ||
var periods = manifest.Period_asArray || [manifest.Period]; | ||
if (periods) { | ||
for (var i = 0; i < periods.length; i++) { | ||
var sets = periods[i].AdaptationSet_asArray || periods[i].AdaptationSet; | ||
if (sets) { | ||
for (var j = 0; j < sets.length; j++) { | ||
var representations = sets[j].Representation_asArray || [sets[j].Representation]; | ||
if (representations) { | ||
for (var k = 0; k < representations.length; k++) { | ||
var rep = representations[k]; | ||
if (rep.mimeType === 'video/mp4') { | ||
rep.codecs = rep.codecs.replace('avc3', 'avc1'); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
return manifest; | ||
} | ||
return { | ||
@@ -54,0 +88,0 @@ filter: filter, |
@@ -125,3 +125,3 @@ define('bigscreenplayer/playbackstrategy/msestrategy', | ||
var manifest = event.data; | ||
ManifestModifier.filter(manifest, window.bigscreenPlayer.representationOptions || {}); | ||
ManifestModifier.filter(manifest, window.bigscreenPlayer.representationOptions || {}, window.bigscreenPlayer.oldDashCodecRequired); | ||
ManifestModifier.generateBaseUrls(manifest, mediaSources); | ||
@@ -128,0 +128,0 @@ } |
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
7636587
73145