Skip to content

Commit

Permalink
Merge pull request #2 from Dash-Industry-Forum/development
Browse files Browse the repository at this point in the history
Merge latest dash.js changse
  • Loading branch information
Lloyd Wallis committed Dec 19, 2014
2 parents 97e29e4 + 71ec727 commit 45057ef
Show file tree
Hide file tree
Showing 174 changed files with 23,623 additions and 16,953 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,6 @@ pip-log.txt

# Mac crap
.DS_Store

# ignore any jsdoc output
/jsdoc/**/*
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
"MSMediaKeys",
"MediaKeys",
"Caster",
"TextTrackCue"]
"TextTrackCue",
"HTMLMediaElement"]
}
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- "0.11"
- "0.10"
121 changes: 76 additions & 45 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
module.exports = function(grunt) {
grunt.initConfig({
connect: {
default_options: {}
default_options: {},
dev: {
options: {
port: 9999,
keepalive: true
}
}
},
watch: {},
jshint: {
Expand All @@ -10,24 +16,46 @@ module.exports = function(grunt) {
jshintrc: ".jshintrc"
}
},
uglify : {
min : {
uglify: {
min: {
files: {
"dash.min.js" : [
"dash.min.js": [
"app/js/streaming/MediaPlayer.js",
"app/js/streaming/Context.js",
"app/js/dash/Dash.js",
"app/js/dash/DashContext.js",
"app/lib/q.js",
"app/lib/xml2json.js",
"app/lib/objectiron.js",
"app/lib/dijon.js",
"app/js/*/**/*.js"],
"app/js/*/**/*.js"
]
}
},
all: {
files: {
"dash.all.js": [
"./app/lib/xml2json.js",
"./app/lib/objectiron.js",
"./app/lib/dijon.js",
"./app/lib/Math.js",
"./app/lib/long.js",
"./app/lib/base64.js",
"./app/js/streaming/MediaPlayer.js",
"./app/js/streaming/Context.js",
"./app/js/dash/Dash.js",
"./app/js/dash/DashContext.js",
"./app/js/*/**/*.js"
]
}
},
all : {
debug: {
options: {
beautify: true,
compress: false,
mangle: false
},
files: {
"dash.all.js" : [
"dash.debug.js": [
"./app/lib/q.js",
"./app/lib/xml2json.js",
"./app/lib/objectiron.js",
Expand All @@ -39,7 +67,8 @@ module.exports = function(grunt) {
"./app/js/streaming/Context.js",
"./app/js/dash/Dash.js",
"./app/js/dash/DashContext.js",
"./app/js/*/**/*.js"]
"./app/js/*/**/*.js"
]
}
}
},
Expand All @@ -50,54 +79,56 @@ module.exports = function(grunt) {
"./app/js/streaming/Context.js",
"./app/js/dash/Dash.js",
"./app/js/dash/DashContext.js",
"./app/js/*/**/*.js"],

"./app/js/*/**/*.js"
],
options: {
host: 'http://127.0.0.1:8000/',
keepRunner: true,
helpers: [
"./test/js/utils/MPDfiles.js",
"./test/js/utils/Utils.js",
"./test/js/utils/ValidateUrl.js",
"./app/js/Main.js"],
"./test/js/utils/Helpers.js",
"./test/js/utils/SpecHelper.js",
"./test/js/utils/ObjectsHelper.js",
"./test/js/utils/MpdHelper.js",
"./test/js/utils/VOHelper.js"
],
specs: [
'./test/js/dash/DashParser_Suite.js',
'./test/js/dash/FragmentExtensions_Suite.js',
'./test/js/dash/DashMetricsExtensions_Suite.js',
'./test/js/dash/DashMetricsConverter_Suite.js',
'./test/js/dash/DashManifestExtensions_Suite.js',
'./test/js/dash/DashManifestExtensionsNeg_Suite.js',
'./test/js/dash/DashHandler_Suite.js',
'./test/js/streaming/MediaPlayer_Suite.js',
'./test/js/streaming/Stream_Suite.js',
'./test/js/streaming/AbrController_Suite.js',
'./test/js/streaming/BufferController_Suite.js',
'./test/js/streaming/Capabilities_Suite.js',
'./test/js/streaming/MetricsModel_Suite.js',
'./test/js/streaming/ManifestUpdater_Suite.js',
'./test/js/streaming/FragmentController_Suite.js',
"./test/js/streaming/VideoModel_Suite.js",
'./test/js/streaming/ManifestLoader_Suite.js'
],
'./test/js/dash/TimelineConverterSpec.js',
'./test/js/dash/DashHandlerSpec.js',
'./test/js/dash/RepresentationControllerSpec.js',
'./test/js/streaming/MediaPlayerSpec.js',
'./test/js/streaming/FragmentControllerSpec.js',
'./test/js/streaming/FragmentModelSpec.js',
'./test/js/streaming/AbrControllerSpec.js'
],
vendor: [
"./app/lib/jquery/jquery-1.10.2.min.js",
"./app/lib/q.js",
"./app/lib/jquery/jquery-1.10.2.min.js",
"./app/lib/xml2json.js",
"./app/lib/objectiron.js",
"./app/lib/objectiron.js",
"./app/lib/Math.js",
"./app/lib/long.js",
"./app/lib/kendo/kendo.web.min.js",
"./app/lib/dijon.js",
"./app/lib/base64.js"],
template : require('grunt-template-jasmine-istanbul'),
"./app/lib/dijon.js",
"./app/lib/base64.js"
],
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'reports/coverage.json',
report: 'reports/coverage'},
report: 'reports/coverage'
},
junit: {
path: grunt.option('jsunit-path'),
consolidate: true}
path: grunt.option('jsunit-path'),
consolidate: true
}
}
}
},
jsdoc: {
dist: {
options: {
destination: 'jsdoc/JSDoc',
configure: "jsdoc/jsdoc_conf.json"
}
}
}
});

Expand All @@ -107,8 +138,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.loadNpmTasks('grunt-jsdoc');

// Define tasks
grunt.registerTask('default', ['jshint','connect','jasmine','uglify']);
};
grunt.registerTask('default', ['jshint','connect:default_options','jasmine','uglify', 'jsdoc']);
};
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# dash.js

JSHint and Jasmine status: [![JSHint and Jasmine](http://img.shields.io/travis/Dash-Industry-Forum/dash.js/development.svg?style=flat-square)](https://travis-ci.org/Dash-Industry-Forum/dash.js)

A reference client implementation for the playback of MPEG DASH via JavaScript and compliant browsers. Learn more about DASH IF Reference Client.

If your intent is to use the player code without contributing back to this project, then use the MASTER branch which holds the approved and stable public releases.
Expand All @@ -19,9 +21,59 @@ Download 'master' or latest tagged release, extract and open main folder dash.js
3. [install grunt-template-jasmine-istanbul](https://github.com/maenu/grunt-template-jasmine-istanbul)
* npm install grunt-template-jasmine-istanbul --save-dev
4. install some other dependencies:
* npm install grunt-contrib-connect grunt-contrib-watch grunt-contrib-jshint grunt-contrib-uglify
* npm install grunt-contrib-connect grunt-contrib-watch grunt-contrib-jshint grunt-contrib-uglify grunt-jsdoc-plugin

### Build / Run tests:
```
grunt --config Gruntfile.js --force
```

## Getting Started
Create a video element somewhere in your html. For our purposes, make sure to set the controls property to true.
```
<video id="videoPlayer" controls="true"></video>
```
Add dash.all.js to the end of the body.
```
<body>
...
<script src="yourPathToDash/dash.all.js"></script>
</body>
```
Now comes the good stuff. We need to create a dash context. Then from that context we create a media player, initialize it, attach it to our "videoPlayer" and then tell it where to get the video from. We will do this in an anonymous self executing function, that way it will run as soon as the page loads. So, here is how we do it:
``` js
(function(){
var url = "http://dash.edgesuite.net/dash264/TestCases/1c/qualcomm/2/MultiRate.mpd";
var context = new Dash.di.DashContext();
var player = new MediaPlayer(context);
player.startup();
player.attachView(document.querySelector("#videoPlayer"));
player.attachSource(url);
})();
```

When it is all done, it should look similar to this:
```
<!doctype html>
<html>
<head>
<title>Dash.js Rocks</title>
</head>
<body>
<div>
<video id="videoPlayer" controls="true"></video>
</div>
<script src="yourPathToDash/dash.all.js"></script>
<script>
(function(){
var url = "http://dash.edgesuite.net/akamai/test/caption_test/ElephantsDream/elephants_dream_480p_heaac5_1.mpd";
var context = new Dash.di.DashContext();
var player = new MediaPlayer(context);
player.startup();
player.attachView(document.querySelector("#videoPlayer"));
player.attachSource(url);
})();
</script>
</body>
</html>
```
10 changes: 10 additions & 0 deletions app/contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
{
"name": "Senthil",
"link": "https://github.com/senthil-codr"
},
{
"name": "Brightcove",
"logo": "app/img/brightcove.png",
"link": "https://www.brightcove.com"
},
{
"name": "Fraunhofer Fokus",
"logo": "app/img/fh_fokus.png",
"link": "http://www.fokus.fraunhofer.de/en/fame/index.html"
}
]
}
65 changes: 65 additions & 0 deletions app/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,71 @@ chart {
overflow: scroll;
}

#manifestInfo {
height: auto;
overflow: auto;
white-space: nowrap;
position: relative;
}

#manifestInfo > div {
overflow: auto;
}

.manifest-info-box {
display: inline-block;
width: 300px;
vertical-align: top;
}

.manifest-info-item:first-child {
width: 600px;
}

.manifest-info-item:first-child span {
padding-left: 300px;
}

.manifest-info-content {
display: inline-block;
width: 100%;
}

.manifest-info-content:nth-of-type(even) {
background-color: #e1edf7;
}

.manifest-nested-info {
}

.manifest-info-content[header]:before {
content: attr(header);
position: absolute;
width: 250px;
color: #428BCA;
background-color: white;
left: 0;
}

.manifest-info-content.manifest-nested-info[header]:before {
padding-left: 20px;
}

.manifest-info-content[header]:nth-of-type(even):before {
background-color: #e1edf7;
}

.manifest-info-content[header="Period"],
.manifest-info-content[header="Period"]:before {
background-color: #e0ffff;
}

.manifest-info-content[header="Representation"],
.manifest-info-content[header="Representation"]:before {
background-color: #f5fffa;
}


#notes {
height: 340px;
max-height: 340px;
Expand Down
Binary file added app/img/brightcove.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/img/fh_fokus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 45057ef

Please sign in to comment.