Socket
Socket
Sign inDemoInstall

bigscreen-player

Package Overview
Dependencies
Maintainers
3
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bigscreen-player - npm Package Compare versions

Comparing version 2.7.0 to 2.7.1

2

package.json
{
"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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc