Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into DC-7-create-test-cases-for-blim-env

* 'master' of https://github.com/Dash-Industry-Forum/dash.js: (97 commits)
  adding dist files to master
  Adding release notes to Reference player.
  Adding release notes to Reference player.
  Fix Dash-Industry-Forum#521 - properly support path-absolute BaseURLs
  Revert "For SegmentTemplate, only include available segments in DVRInfo"
  fix Dash-Industry-Forum#1463 - update documentation for setScheduleWhilePaused
  use sidx exclusively if there is an indexRange - thanks @bwidtmann
  Enable SegmentTimeline within SegmentList
  ManifestModel setValue should not trigger MANIFEST_LOADED when reset
  Update ISSUE_TEMPLATE.md
  Dash-Industry-Forum#1145 cleanup protection log
  Fix for issue Dash-Industry-Forum#887
  Removed build artifacts
  Reverted grunt changes
  Added support for filtering out key systems when no protection data for that key system is present
  fixed audio only buffer targets for longform etc...
  added missing comma
  fix for failing end test in browserstack
  Dash-Industry-Forum#1445 add a robustness level capabilities configuration for the protection controller. This is optional for Widevine Chrome to prevent robustness level warnings.
  remove check on required quality / check not needed anymore. See Dash-Industry-Forum#1443
  ...
  • Loading branch information
marcoslhc committed Jul 18, 2016
2 parents 1313d8e + 990c67c commit 3859753
Show file tree
Hide file tree
Showing 197 changed files with 16,413 additions and 11,300 deletions.
11 changes: 11 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,16 @@
"validateParameterSeparator": ", ",
"disallowMultipleVarDecl": {
"allExcept": ["undefined"]
},
"jsDoc": {
"checkTypes": "strictNativeCase",
"checkParamExistence": true,
"checkParamNames": true,
"requireParamTypes": true,
"checkRedundantParams": true,
"checkReturnTypes": true,
"checkRedundantReturns": true,
"requireReturnTypes": true,
"checkTypes": true
}
}
8 changes: 4 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = function (grunt) {
standalone: 'dashjs.MediaPlayer'
},
plugin: [
['browserify-derequire']
'browserify-derequire', 'bundle-collapser/plugin'
],
transform: ['babelify']
}
Expand All @@ -140,7 +140,7 @@ module.exports = function (grunt) {
standalone: 'dashjs.Protection'
},
plugin: [
['browserify-derequire']
'browserify-derequire', 'bundle-collapser/plugin'
],
transform: ['babelify']
}
Expand All @@ -155,7 +155,7 @@ module.exports = function (grunt) {
standalone: 'dashjs.MetricsReporting'
},
plugin: [
['browserify-derequire']
'browserify-derequire', 'bundle-collapser/plugin'
],
transform: ['babelify']
}
Expand All @@ -169,7 +169,7 @@ module.exports = function (grunt) {
debug: true
},
plugin: [
['browserify-derequire']
'browserify-derequire', 'bundle-collapser/plugin'
],
transform: ['babelify']
}
Expand Down
25 changes: 25 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- If you are raising a bug playing a stream, you must fill out the following or your issue may not be responded to. For features or improvements, you may delete this. -->
##### Environment
<!-- Replace [ ] with [x] to check off the list -->
- [ ] The MPD passes the DASH-IF Conformance Tool on http://dashif.org/conformance.html
- [ ] The stream has correct Access-Control-Allow-Origin headers (CORS)
- [ ] There are no network errors such as 404s in the browser console when trying to play the stream
- [ ] The issue observed is not mentioned on https://github.com/Dash-Industry-Forum/dash.js/wiki/FAQ
- [ ] The issue occurs in the latest reference client on http://dashif.org/reference/players/javascript/ and not just on my page
* Link to playable MPD file:
* Dash.js version:
* Browser name/version:
* OS name/version:

##### Steps to reproduce
1. Please provide clear steps to reproduce your problem
2. If the bug is intermittent, give a rough frequency if possible

##### Observed behaviour
Describe what the player is doing that is unexpected or undesired behaviour.

##### Console output
```
Paste the contents of the browser console here.
You may need to enable debug logging in dash.js by calling player.getDebug().setLogToBrowserConsole(true) if you are using your own page.
```
6 changes: 3 additions & 3 deletions contrib/akamai/controlbar/ControlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ var ControlBar = function(dashjsMediaPlayer) {
document.webkitCancelFullScreen();
}
videoController.classList.remove('video-controller-fullscreen');
}
},

onFullscreenClick = function(e){
if(!isFullscreen()) {
Expand Down Expand Up @@ -371,7 +371,7 @@ var ControlBar = function(dashjsMediaPlayer) {
if (!player) {
throw new Error("Please pass an instance of MediaPlayer.js when instantiating the ControlBar Object");
}
video = player.getVideoModel().getElement();
video = player.getVideoElement();
if (!video) {
throw new Error("Please call initialize after you have called attachView on MediaPlayer.js");
}
Expand Down Expand Up @@ -446,4 +446,4 @@ var ControlBar = function(dashjsMediaPlayer) {
document.removeEventListener("webkitfullscreenchange", onFullScreenChange);
}
}
}
}
9 changes: 3 additions & 6 deletions contrib/videojs/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
<head>

<!-- Loading Video.js CDN-hosted Scripts from videojs.com -->
<link href="http://vjs.zencdn.net/4.12/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/4.12/video.js"></script>
<script src="../../dist/dash.all.js"></script>

<!-- Load the videojs-contrib-dash stylesheet anywhere -->
<link href="videojs-dash.css" rel="stylesheet">
<link href="http://vjs.zencdn.net/5.8/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/5.8/video.js"></script>
<script src="../../dist/dash.all.debug.js"></script>

<!-- Load the videojs-contrib-dash script *after* both other projects -->
<script src="videojs-dash.js"></script>
Expand Down
1 change: 0 additions & 1 deletion contrib/videojs/videojs-dash.css

This file was deleted.

183 changes: 70 additions & 113 deletions contrib/videojs/videojs-dash.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
/*! videojs-contrib-dash - v1.1.0 - 2015-07-24
* Copyright (c) 2015 Brightcove */
(function(window, videojs) {
'use strict';
/*! videojs-contrib-dash - v2.2.0 - 2016-05-04
* Copyright (c) 2016 Brightcove */
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
if (typeof window !== "undefined") {
module.exports = window;
} else if (typeof global !== "undefined") {
module.exports = global;
} else if (typeof self !== "undefined"){
module.exports = self;
} else {
module.exports = {};
}

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],2:[function(require,module,exports){
(function (global){
'use strict';
var window_ = require('global/window');
var videojs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var dashjs = (typeof window !== "undefined" ? window['dashjs'] : typeof global !== "undefined" ? global['dashjs'] : null);

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;
};

/**
Expand All @@ -39,9 +31,7 @@
* Use Dash.js to playback DASH content inside of Video.js via a SourceHandler
*/
function Html5DashJS (source, tech) {
var
options = tech.options(),
manifestSource;
var manifestSource;

this.tech_ = tech;
this.el_ = tech.el();
Expand All @@ -57,96 +47,44 @@
// again later once everything is setup
tech.isReady_ = false;

if (Html5DashJS.updateSourceData) {
source = Html5DashJS.updateSourceData(source);
}

manifestSource = source.src;
this.keySystemOptions_ = Html5DashJS.buildDashJSProtData(source.keySystemOptions);

// We have to hide errors since SRC_UNSUPPORTED is thrown by the video element when
// we set src = '' in order to clear the mediaKeys
Html5DashJS.hideErrors(this.elParent_);

// Must be before anything is initialized since we are overridding a global object
// injection
if (Html5DashJS.useVideoJSDebug) {
Html5DashJS.useVideoJSDebug(videojs);
}

// Save the context after the first initialization for subsequent instances
Html5DashJS.context_ = Html5DashJS.context_ || new Dash.di.DashContext();
Html5DashJS.context_ = Html5DashJS.context_ || {};

// But make a fresh MediaPlayer each time the sourceHandler is used
this.mediaPlayer_ = new MediaPlayer(Html5DashJS.context_);
this.mediaPlayer_ = dashjs.MediaPlayer(Html5DashJS.context_).create();

// Log MedaPlayer messages through video.js
if (Html5DashJS.useVideoJSDebug) {
Html5DashJS.useVideoJSDebug(this.mediaPlayer_);
}

// Must run controller before these two lines or else there is no
// element to bind to.
this.mediaPlayer_.startup();
this.mediaPlayer_.initialize();
this.mediaPlayer_.attachView(this.el_);

// Dash.js autoplays by default
if (!options.autoplay) {
this.mediaPlayer_.setAutoPlay(false);
}

// Fetches and parses the manifest - WARNING the callback is non-standard "error-last" style
this.mediaPlayer_.retrieveManifest(manifestSource, videojs.bind(this, this.initializeDashJS));
}

Html5DashJS.prototype.initializeDashJS = function (manifest, err) {
var manifestProtectionData = {};

if (err) {
Html5DashJS.showErrors(this.elParent_);
this.tech_.triggerReady();
this.dispose();
return;
}

// If we haven't received protection data from the outside world try to get it from the manifest
// We merge the two allowing the manifest to override any keySystemOptions provided via src()
if (Html5DashJS.getWidevineProtectionData) {
manifestProtectionData = Html5DashJS.getWidevineProtectionData(manifest);
this.keySystemOptions_ = mergeOptions(
this.keySystemOptions_,
manifestProtectionData);
}

// We have to reset any mediaKeys before the attachSource call below
this.resetSrc_(videojs.bind(this, function afterMediaKeysReset () {
Html5DashJS.showErrors(this.elParent_);
// Dash.js autoplays by default, video.js will handle autoplay
this.mediaPlayer_.setAutoPlay(false);

// Attach the source with any protection data
this.mediaPlayer_.attachSource(manifest, null, this.keySystemOptions_);
// Attach the source with any protection data
this.mediaPlayer_.setProtectionData(this.keySystemOptions_);
this.mediaPlayer_.attachSource(manifestSource);

this.tech_.triggerReady();
}));
};

/*
* Add a css-class that is used to temporarily hide the error dialog while so that
* we don't see a flash of the dialog box when we remove the video element's src
* to reset MediaKeys in resetSrc_
*/
Html5DashJS.hideErrors = function (el) {
el.className += ' vjs-dashjs-hide-errors';
};

/*
* Remove the css-class above to enable the error dialog to be shown once again
*/
Html5DashJS.showErrors = function (el) {
// The video element's src is set asynchronously so we have to wait a while
// before we unhide any errors
// 250ms is arbitrary but I haven't seen dash.js take longer than that to initialize
// in my testing
setTimeout(function () {
el.className = el.className.replace('vjs-dashjs-hide-errors', '');
}, 250);
};
this.tech_.triggerReady();
}

/*
* Iterate over the `keySystemOptions` array and convert each object into
* the type of object Dash.js expects in the `protData` argument.
*
* Also rename 'licenseUrl' property in the options to an 'laURL' property
* Also rename 'licenseUrl' property in the options to an 'serverURL' property
*/
Html5DashJS.buildDashJSProtData = function (keySystemOptions) {
var
Expand All @@ -161,10 +99,10 @@

for (i = 0; i < keySystemOptions.length; i++) {
keySystem = keySystemOptions[i];
options = mergeOptions({}, keySystem.options);
options = videojs.mergeOptions({}, keySystem.options);

if (options.licenseUrl) {
options.laURL = options.licenseUrl;
options.serverURL = options.licenseUrl;
delete options.licenseUrl;
}

Expand Down Expand Up @@ -202,14 +140,12 @@
this.resetSrc_(function noop(){});
};

// Only add the SourceHandler if the browser supports MediaSourceExtensions
if (!!window.MediaSource) {
videojs.Html5.registerSourceHandler({
videojs.DashSourceHandler = function() {
return {
canHandleSource: function (source) {
var dashTypeRE = /^application\/dash\+xml/i;
var dashExtRE = /\.mpd/i;

if (dashTypeRE.test(source.type)) {
if (videojs.DashSourceHandler.canPlayType(source.type)) {
return 'probably';
} else if (dashExtRE.test(source.src)){
return 'maybe';
Expand All @@ -220,9 +156,30 @@

handleSource: function (source, tech) {
return new Html5DashJS(source, tech);
},

canPlayType: function (type) {
return videojs.DashSourceHandler.canPlayType(type);
}
});
};
};

videojs.DashSourceHandler.canPlayType = function (type) {
var dashTypeRE = /^application\/dash\+xml/i;
if (dashTypeRE.test(type)) {
return 'probably';
}

return '';
};

// Only add the SourceHandler if the browser supports MediaSourceExtensions
if (!!window_.MediaSource) {
videojs.getComponent('Html5').registerSourceHandler(videojs.DashSourceHandler(), 0);
}

videojs.Html5DashJS = Html5DashJS;
})(window, window.videojs);
module.exports = Html5DashJS;

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"global/window":1}]},{},[2]);
6 changes: 3 additions & 3 deletions contrib/videojs/videojs-dash.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3859753

Please sign in to comment.