Skip to content

Commit

Permalink
Merge pull request #2 from spiterikevin/development
Browse files Browse the repository at this point in the history
Merge recent changes from Dash-Industry-Forum development.
  • Loading branch information
spiterikevin committed Feb 5, 2016
2 parents a528905 + a339763 commit abe4f08
Show file tree
Hide file tree
Showing 44 changed files with 686 additions and 371 deletions.
12 changes: 6 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ module.exports = function (grunt) {
options: {
browserifyOptions: {
debug: true,
standalone: 'MediaPlayer'
standalone: 'dashjs.MediaPlayer'
},
plugin: [
['browserify-derequire']
Expand All @@ -137,7 +137,7 @@ module.exports = function (grunt) {
options: {
browserifyOptions: {
debug: true,
standalone: 'Protection'
standalone: 'dashjs.Protection'
},
plugin: [
['browserify-derequire']
Expand All @@ -152,7 +152,7 @@ module.exports = function (grunt) {
options: {
browserifyOptions: {
debug: true,
standalone: 'MetricsReporting'
standalone: 'dashjs.MetricsReporting'
},
plugin: [
['browserify-derequire']
Expand All @@ -162,11 +162,11 @@ module.exports = function (grunt) {
},
all: {
files: {
'build/temp/dash.all.debug.js': ['src/All.js']
'build/temp/dash.all.debug.js': ['index.js']
},
options: {
browserifyOptions: {
debug: true,
debug: true
},
plugin: [
['browserify-derequire']
Expand All @@ -177,7 +177,7 @@ module.exports = function (grunt) {

watch: {
files: {
'build/temp/dash.all.debug.js': ['src/All.js']
'build/temp/dash.all.debug.js': ['index.js']
},
options: {
watch: true,
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Now comes the good stuff. We need to create a MediaPlayer and initialize it. We
``` js
(function(){
var url = "http://dash.edgesuite.net/envivio/Envivio-dash2/manifest.mpd";
var player = MediaPlayer().create();
var player = dashjs.MediaPlayer().create();
player.initialize(document.querySelector("#videoPlayer"), url, true);
})();
```
Expand All @@ -73,11 +73,15 @@ When it is all done, it should look similar to this:
<script>
(function(){
var url = "http://dash.edgesuite.net/envivio/Envivio-dash2/manifest.mpd";
var player = MediaPlayer().create();
var player = dashjs.MediaPlayer().create();
player.initialize(document.querySelector("#videoPlayer"), url, true);
})();
</script>
</body>
</html>
```


## Tested With

[<img src="https://cloud.githubusercontent.com/assets/7864462/12837037/452a17c6-cb73-11e5-9f39-fc96893bc9bf.png" alt="Browser Stack Logo" width="400">](https://www.browserstack.com/)
20 changes: 10 additions & 10 deletions contrib/akamai/controlbar/ControlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ var ControlBar = function(dashjsMediaPlayer) {
videoContainer = player.getVideoContainer();
captionBtn.classList.add("hide");

player.on(MediaPlayer.events.PLAYBACK_STARTED, onPlayStart);
player.on(MediaPlayer.events.PLAYBACK_PAUSED, onPlaybackPaused);
player.on(MediaPlayer.events.PLAYBACK_TIME_UPDATED, onPlayTimeUpdate);
player.on(MediaPlayer.events.PLAYBACK_SEEKED, onSeeked);
player.on(MediaPlayer.events.TEXT_TRACKS_ADDED, onTracksAdded);
player.on(dashjs.MediaPlayer.events.PLAYBACK_STARTED, onPlayStart);
player.on(dashjs.MediaPlayer.events.PLAYBACK_PAUSED, onPlaybackPaused);
player.on(dashjs.MediaPlayer.events.PLAYBACK_TIME_UPDATED, onPlayTimeUpdate);
player.on(dashjs.MediaPlayer.events.PLAYBACK_SEEKED, onSeeked);
player.on(dashjs.MediaPlayer.events.TEXT_TRACKS_ADDED, onTracksAdded);

playPauseBtn.addEventListener("click", onPlayPauseClick);
muteBtn.addEventListener("click", onMuteClick);
Expand Down Expand Up @@ -435,11 +435,11 @@ var ControlBar = function(dashjsMediaPlayer) {
seekbar.removeEventListener("change", onSeekBarChange);
seekbar.removeEventListener("input", onSeeking);
volumebar.removeEventListener("input", setVolume);
player.off(MediaPlayer.events.PLAYBACK_STARTED, onPlayStart);
player.off(MediaPlayer.events.PLAYBACK_PAUSED, onPlaybackPaused);
player.off(MediaPlayer.events.PLAYBACK_TIME_UPDATED, onPlayTimeUpdate);
player.off(MediaPlayer.events.PLAYBACK_SEEKED, onSeeked);
player.off(MediaPlayer.events.TEXT_TRACKS_ADDED, onTracksAdded);off
player.off(dashjs.MediaPlayer.events.PLAYBACK_STARTED, onPlayStart);
player.off(dashjs.MediaPlayer.events.PLAYBACK_PAUSED, onPlaybackPaused);
player.off(dashjs.MediaPlayer.events.PLAYBACK_TIME_UPDATED, onPlayTimeUpdate);
player.off(dashjs.MediaPlayer.events.PLAYBACK_SEEKED, onSeeked);
player.off(dashjs.MediaPlayer.events.TEXT_TRACKS_ADDED, onTracksAdded);off
document.removeEventListener("fullscreenchange", onFullScreenChange);
document.removeEventListener("MSFullscreenChange", onFullScreenChange);
document.removeEventListener("mozfullscreenchange", onFullScreenChange);
Expand Down
20 changes: 14 additions & 6 deletions src/All.js → index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,21 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

import MediaPlayer from './streaming/MediaPlayer.js';
import Protection from './streaming/protection/Protection.js';
import MetricsReporting from './streaming/metrics/MetricsReporting.js';
import MediaPlayer from './src/streaming/MediaPlayer.js';
import Protection from './src/streaming/protection/Protection.js';
import MetricsReporting from './src/streaming/metrics/MetricsReporting.js';
import MediaPlayerFactory from './src/streaming/MediaPlayerFactory.js';


// Shove both of these into the global scope
var context = window || global;
context.MediaPlayer = MediaPlayer;
context.Protection = Protection;
context.MetricsReporting = MetricsReporting;

context.dashjs = {
MediaPlayer: MediaPlayer,
Protection: Protection,
MetricsReporting: MetricsReporting,
MediaPlayerFactory: MediaPlayerFactory
};

export default context.dashjs;
export { MediaPlayer, Protection, MetricsReporting, MediaPlayerFactory };
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dashjs",
"version": "2.0.0",
"description": "A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.",
"main": "dist/dash.all.min.js",
"main": "index.js",
"scripts": {
"test": "mocha --require mochahook",
"prepublish": "grunt prepublish",
Expand Down
65 changes: 0 additions & 65 deletions samples/ad-insertion/adinsertion_inband.html

This file was deleted.

69 changes: 0 additions & 69 deletions samples/ad-insertion/adinsertion_inline.html

This file was deleted.

6 changes: 6 additions & 0 deletions samples/ad-insertion/css/bootstrap.min.css

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions samples/ad-insertion/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
body {
background-color : #294f6b;
color:white;
font-size: 14px;
}

a {
color: #59b4d4;
}
a:hover {
color: lightgrey;
}

.panel {
color:black;
}

.xlink-item {
cursor: pointer;
color: #337ab7;
}

.tdcursor {
cursor:pointer;
color: #337ab7;
}
Binary file removed samples/ad-insertion/images/background.png
Binary file not shown.
Binary file removed samples/ad-insertion/images/famium.png
Binary file not shown.
Binary file removed samples/ad-insertion/images/fokus_small.jpg
Binary file not shown.
Binary file added samples/ad-insertion/img/event_wf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
71 changes: 71 additions & 0 deletions samples/ad-insertion/inband.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<head>
<title>Fraunhofer Fokus - Ad Insertion Sample</title>
<script src="../../dist/dash.all.debug.js"></script>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-2"><a href="https://www.fokus.fraunhofer.de/go/fame"><img src="img/fokus.png"
class="img-responsive"></a></div>
<div class="col-md-2"><a href="https://www.fokus.fraunhofer.de/go/fame"><img src="img/fame.png"
class="img-responsive "></a></div>
</div>
<div class="row">
<div class="col-md-4">
<h4>Post-Roll Ad-Insertion with DASH + W3C MediaSource Extensions + Inband Event MPD Reload</h4>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Working principle</h3>
</div>
<div class="panel-body">
<ol>
<li>The server provides an MPD containing an InbandEventStream element on Period Level.
The schmeIdUri and the value of the Eventstream are set according to ISO/IEC 23009-1
5.10.4.1.<br>
<pre>&lt;InbandEventStream schemeIdUri="urn:mpeg:dash:event:2012" value="1"/&gt;</pre>
Additionally one segment contains an EMSG Box with the same schemeIdUri and the same value.
</li>
<li>During the playback the Client parses the EMSG Box, removes it from the segment and
schedules the MPD Reload.
</li>
<li>The new MPD contains an additional period with ad content, which will be played after 20
seconds
</li>
</ol>
<img src="img/event_wf.png" class="img-responsive">
</div>
</div>
</div>
<div class="col-md-8">
<video controls="true" id="vid" width="640" height="480"></video>
</div>
</div>
<div class="row">
<div class="col-md-2"><p><a href="index.html">Back to selection</a></p></div>
</div>
</div>
<script> (function () {
$.get("http://se-mashup.fokus.fraunhofer.de:8080/getSession", function (data) {
var url = "http://se-mashup.fokus.fraunhofer.de:8080/dash/assets/adinsertion-samples/events/inband/dash.mpd?sid=" + data.sessionID;
var player = dashjs.MediaPlayer().create();
player.initialize(document.querySelector("#vid"), url, true);
})
})();
</script>
</body>
</html></title>
</head>
<body>

</body>
</html>
Loading

0 comments on commit abe4f08

Please sign in to comment.