videojs-contrib-dash
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,2 +0,2 @@ | ||
/*! videojs-contrib-dash - v1.0.1 - 2015-07-13 | ||
/*! videojs-contrib-dash - v1.0.2 - 2015-07-23 | ||
* Copyright (c) 2015 Brightcove */ | ||
@@ -6,2 +6,32 @@ (function(window, videojs) { | ||
var | ||
isArray = function(a) { | ||
return Object.prototype.toString.call(a) === '[object Array]'; | ||
}, | ||
isObject = function (a) { | ||
return Object.prototype.toString.call(a) === '[object Object]'; | ||
}, | ||
mergeOptions = function(obj1, obj2){ | ||
var key, val1, val2, res; | ||
// make a copy of obj1 so we're not overwriting original values. | ||
// like prototype.options_ and all sub options objects | ||
res = {}; | ||
for (key in obj2){ | ||
if (obj2.hasOwnProperty(key)) { | ||
val1 = obj1[key]; | ||
val2 = obj2[key]; | ||
// Check if both properties are pure objects and do a deep merge if so | ||
if (isObject(val1) && isObject(val2)) { | ||
obj1[key] = mergeOptions(val1, val2); | ||
} else { | ||
obj1[key] = obj2[key]; | ||
} | ||
} | ||
} | ||
return obj1; | ||
}; | ||
/** | ||
@@ -76,3 +106,3 @@ * videojs-contrib-dash | ||
manifestProtectionData = Html5DashJS.getWidevineProtectionData(manifest); | ||
this.keySystemOptions_ = videojs.obj.deepMerge( | ||
this.keySystemOptions_ = mergeOptions( | ||
this.keySystemOptions_, | ||
@@ -212,3 +242,3 @@ manifestProtectionData); | ||
Html5DashJS.hideErrors = function (el) { | ||
videojs.addClass(el, 'vjs-dashjs-hide-errors'); | ||
el.className += 'vjs-dashjs-hide-errors'; | ||
}; | ||
@@ -225,3 +255,3 @@ | ||
setTimeout(function () { | ||
videojs.removeClass(el, 'vjs-dashjs-hide-errors'); | ||
el.className = el.className.replace('vjs-dashjs-hide-errors', ''); | ||
}, 250); | ||
@@ -243,3 +273,3 @@ }; | ||
if (!keySystemOptions || !videojs.obj.isArray(keySystemOptions)) { | ||
if (!keySystemOptions || !isArray(keySystemOptions)) { | ||
return output; | ||
@@ -250,3 +280,3 @@ } | ||
keySystem = keySystemOptions[i]; | ||
options = videojs.obj.deepMerge({}, keySystem.options); | ||
options = mergeOptions({}, keySystem.options); | ||
@@ -253,0 +283,0 @@ if (options.licenseUrl) { |
@@ -1,3 +0,3 @@ | ||
/*! videojs-contrib-dash - v1.0.1 - 2015-07-13 | ||
/*! videojs-contrib-dash - v1.0.2 - 2015-07-23 | ||
* Copyright (c) 2015 Brightcove */ | ||
!function(a,b){"use strict";function c(a,d){var e,f=d.options();this.tech_=d,this.el_=d.el(),this.elParent_=this.el_.parentNode,a.src&&(d.isReady_=!1,e=a.src,this.keySystemOptions_=c.buildDashJSProtData(a.keySystemOptions),c.hideErrors(this.elParent_),c.useVideoJSDebug(b),c.context_=c.context_||new Dash.di.DashContext,this.mediaPlayer_=new MediaPlayer(c.context_),this.mediaPlayer_.startup(),this.mediaPlayer_.attachView(this.el_),f.autoplay||this.mediaPlayer_.setAutoPlay(!1),this.mediaPlayer_.retrieveManifest(e,b.bind(this,this.initializeDashJS)))}c.prototype.initializeDashJS=function(a,d){var e={};return d?(c.showErrors(this.elParent_),this.tech_.triggerReady(),void this.dispose()):(c.getWidevineProtectionData&&(e=c.getWidevineProtectionData(a),this.keySystemOptions_=b.obj.deepMerge(this.keySystemOptions_,e)),void this.resetSrc_(b.bind(this,function(){c.showErrors(this.elParent_),this.mediaPlayer_.attachSource(a,null,this.keySystemOptions_),this.tech_.triggerReady()})))},c.useVideoJSDebug=function(a){c.originalDebug||a&&a.log&&a.log.debug&&(c.originalDebug=MediaPlayer.utils.Debug,MediaPlayer.utils.Debug=function(){var b,c=!0,d=!1,e=!1,f=(new Date).getTime();return{system:void 0,eventBus:void 0,setup:function(){this.system.mapValue("log",this.log),b=this.eventBus},setLogTimestampVisible:function(a){d=a},showCalleeName:function(a){e=a},setLogToBrowserConsole:function(a){c=a},getLogToBrowserConsole:function(){return c},log:function(){var g="",h=null;d&&(h=(new Date).getTime(),g+="["+(h-f)+"]"),e&&this.getName&&(g+="["+this.getName()+"]"),this.getMediaType&&this.getMediaType()&&(g+="["+this.getMediaType()+"]"),g.length>0&&(g+=" "),Array.apply(null,arguments).forEach(function(a){g+=a+" "}),c&&a.log.debug(g),b.dispatchEvent({type:"log",message:g})}}})},c.hideErrors=function(a){b.addClass(a,"vjs-dashjs-hide-errors")},c.showErrors=function(a){setTimeout(function(){b.removeClass(a,"vjs-dashjs-hide-errors")},250)},c.buildDashJSProtData=function(a){var c,d,e,f={};if(!a||!b.obj.isArray(a))return f;for(e=0;e<a.length;e++)c=a[e],d=b.obj.deepMerge({},c.options),d.licenseUrl&&(d.laURL=d.licenseUrl,delete d.licenseUrl),f[c.name]=d;return f},c.prototype.resetSrc_=function(a){this.el_&&(this.el_.src="",this.el_.setMediaKeys?this.el_.setMediaKeys(null).then(a,a):a())},c.prototype.dispose=function(){this.mediaPlayer_&&this.mediaPlayer_.reset(),this.resetSrc_(function(){})},a.MediaSource&&b.Html5.registerSourceHandler({canHandleSource:function(a){var b=/^application\/dash\+xml/i,c=/\.mpd/i;return b.test(a.type)?"probably":c.test(a.src)?"maybe":""},handleSource:function(a,b){return new c(a,b)}}),b.Html5DashJS=c}(window,window.videojs); | ||
!function(a,b){"use strict";function c(a,d){var e,f=d.options();this.tech_=d,this.el_=d.el(),this.elParent_=this.el_.parentNode,a.src&&(d.isReady_=!1,e=a.src,this.keySystemOptions_=c.buildDashJSProtData(a.keySystemOptions),c.hideErrors(this.elParent_),c.useVideoJSDebug(b),c.context_=c.context_||new Dash.di.DashContext,this.mediaPlayer_=new MediaPlayer(c.context_),this.mediaPlayer_.startup(),this.mediaPlayer_.attachView(this.el_),f.autoplay||this.mediaPlayer_.setAutoPlay(!1),this.mediaPlayer_.retrieveManifest(e,b.bind(this,this.initializeDashJS)))}var d=function(a){return"[object Array]"===Object.prototype.toString.call(a)},e=function(a){return"[object Object]"===Object.prototype.toString.call(a)},f=function(a,b){var c,d,g,h;h={};for(c in b)b.hasOwnProperty(c)&&(d=a[c],g=b[c],e(d)&&e(g)?a[c]=f(d,g):a[c]=b[c]);return a};c.prototype.initializeDashJS=function(a,d){var e={};return d?(c.showErrors(this.elParent_),this.tech_.triggerReady(),void this.dispose()):(c.getWidevineProtectionData&&(e=c.getWidevineProtectionData(a),this.keySystemOptions_=f(this.keySystemOptions_,e)),void this.resetSrc_(b.bind(this,function(){c.showErrors(this.elParent_),this.mediaPlayer_.attachSource(a,null,this.keySystemOptions_),this.tech_.triggerReady()})))},c.useVideoJSDebug=function(a){c.originalDebug||a&&a.log&&a.log.debug&&(c.originalDebug=MediaPlayer.utils.Debug,MediaPlayer.utils.Debug=function(){var b,c=!0,d=!1,e=!1,f=(new Date).getTime();return{system:void 0,eventBus:void 0,setup:function(){this.system.mapValue("log",this.log),b=this.eventBus},setLogTimestampVisible:function(a){d=a},showCalleeName:function(a){e=a},setLogToBrowserConsole:function(a){c=a},getLogToBrowserConsole:function(){return c},log:function(){var g="",h=null;d&&(h=(new Date).getTime(),g+="["+(h-f)+"]"),e&&this.getName&&(g+="["+this.getName()+"]"),this.getMediaType&&this.getMediaType()&&(g+="["+this.getMediaType()+"]"),g.length>0&&(g+=" "),Array.apply(null,arguments).forEach(function(a){g+=a+" "}),c&&a.log.debug(g),b.dispatchEvent({type:"log",message:g})}}})},c.hideErrors=function(a){a.className+="vjs-dashjs-hide-errors"},c.showErrors=function(a){setTimeout(function(){a.className=a.className.replace("vjs-dashjs-hide-errors","")},250)},c.buildDashJSProtData=function(a){var b,c,e,g={};if(!a||!d(a))return g;for(e=0;e<a.length;e++)b=a[e],c=f({},b.options),c.licenseUrl&&(c.laURL=c.licenseUrl,delete c.licenseUrl),g[b.name]=c;return g},c.prototype.resetSrc_=function(a){this.el_&&(this.el_.src="",this.el_.setMediaKeys?this.el_.setMediaKeys(null).then(a,a):a())},c.prototype.dispose=function(){this.mediaPlayer_&&this.mediaPlayer_.reset(),this.resetSrc_(function(){})},a.MediaSource&&b.Html5.registerSourceHandler({canHandleSource:function(a){var b=/^application\/dash\+xml/i,c=/\.mpd/i;return b.test(a.type)?"probably":c.test(a.src)?"maybe":""},handleSource:function(a,b){return new c(a,b)}}),b.Html5DashJS=c}(window,window.videojs); |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": { | ||
@@ -40,4 +40,4 @@ "name": "Brightcove" | ||
"video.js": "^4.12.4", | ||
"videojs-automation": "git://github.com/forbesjo/videojs-automation" | ||
"videojs-automation": "0.0.1" | ||
} | ||
} |
(function(window, videojs) { | ||
'use strict'; | ||
var | ||
isArray = function(a) { | ||
return Object.prototype.toString.call(a) === '[object Array]'; | ||
}, | ||
isObject = function (a) { | ||
return Object.prototype.toString.call(a) === '[object Object]'; | ||
}, | ||
mergeOptions = function(obj1, obj2){ | ||
var key, val1, val2, res; | ||
// make a copy of obj1 so we're not overwriting original values. | ||
// like prototype.options_ and all sub options objects | ||
res = {}; | ||
for (key in obj2){ | ||
if (obj2.hasOwnProperty(key)) { | ||
val1 = obj1[key]; | ||
val2 = obj2[key]; | ||
// Check if both properties are pure objects and do a deep merge if so | ||
if (isObject(val1) && isObject(val2)) { | ||
obj1[key] = mergeOptions(val1, val2); | ||
} else { | ||
obj1[key] = obj2[key]; | ||
} | ||
} | ||
} | ||
return obj1; | ||
}; | ||
/** | ||
@@ -73,3 +103,3 @@ * videojs-contrib-dash | ||
manifestProtectionData = Html5DashJS.getWidevineProtectionData(manifest); | ||
this.keySystemOptions_ = videojs.obj.deepMerge( | ||
this.keySystemOptions_ = mergeOptions( | ||
this.keySystemOptions_, | ||
@@ -209,3 +239,3 @@ manifestProtectionData); | ||
Html5DashJS.hideErrors = function (el) { | ||
videojs.addClass(el, 'vjs-dashjs-hide-errors'); | ||
el.className += 'vjs-dashjs-hide-errors'; | ||
}; | ||
@@ -222,3 +252,3 @@ | ||
setTimeout(function () { | ||
videojs.removeClass(el, 'vjs-dashjs-hide-errors'); | ||
el.className = el.className.replace('vjs-dashjs-hide-errors', ''); | ||
}, 250); | ||
@@ -240,3 +270,3 @@ }; | ||
if (!keySystemOptions || !videojs.obj.isArray(keySystemOptions)) { | ||
if (!keySystemOptions || !isArray(keySystemOptions)) { | ||
return output; | ||
@@ -247,3 +277,3 @@ } | ||
keySystem = keySystemOptions[i]; | ||
options = videojs.obj.deepMerge({}, keySystem.options); | ||
options = mergeOptions({}, keySystem.options); | ||
@@ -250,0 +280,0 @@ if (options.licenseUrl) { |
var url = require('url'), | ||
Player = require('videojs-automation'), | ||
suiteName, pageUrl; | ||
players = [{ | ||
suiteName: browser.name + ': MPEG-DASH Player', | ||
pageUrl: url.resolve(browser.baseUrl, 'test/functional/no-drm-player.html') | ||
}]; | ||
if (/chrome/i.test(browser.browserName)) { | ||
suiteName = browser.name + ': MPEG-DASH Player w/ Widevine DRM'; | ||
pageUrl = url.resolve(browser.baseUrl, 'test/functional/drm-player.html'); | ||
} else { | ||
// Exclude other browsers for now | ||
return; | ||
players.push({ | ||
suiteName: browser.name + ': MPEG-DASH Player w/ Widevine DRM', | ||
pageUrl: url.resolve(browser.baseUrl, 'test/functional/drm-player.html') | ||
}); | ||
} | ||
if (suiteName && pageUrl) { | ||
describe(suiteName, function() { | ||
players.map(function(p) { | ||
return describe(p.suiteName, function() { | ||
var player; | ||
beforeEach(function() { | ||
player = new Player(url.resolve(browser.baseUrl, pageUrl)); | ||
player = new Player(p.pageUrl); | ||
}); | ||
it('should have no console errors', function() { | ||
player.bigPlayButton().click(); | ||
player.consoleLog().then(function(logs) { | ||
expect(logs.length).toBe(0); | ||
if (!/explorer/i.test(browser.browserName)) { | ||
it('should have no console errors', function() { | ||
player.bigPlayButton().click(); | ||
player.consoleLog().then(function(logs) { | ||
expect(logs.length).toBe(0); | ||
}); | ||
}); | ||
}); | ||
} | ||
@@ -37,2 +41,2 @@ it('should have no player errors', function() { | ||
}); | ||
} | ||
}); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
55911
882
2
20