Skip to content

Commit

Permalink
Merge pull request #1135 from boushley/mediaplayerfactory-readme
Browse files Browse the repository at this point in the history
Describe the MediaPlayerFactory setup steps.
  • Loading branch information
Dan Sparacio authored and Dan Sparacio committed Feb 6, 2016
2 parents 3b91821 + d8912f2 commit fb49ac0
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ View the /samples folder for many other examples of embedding and using the play


## Getting Started

The standard setup method uses javascript to initialize and provide video details to dash.js. `MediaPlayerFactory` provides an alternative declarative setup syntax.

### Standard Setup

Create a video element somewhere in your html. For our purposes, make sure to set the controls property to true.
```html
<video id="videoPlayer" controls="true"></video>
Expand Down Expand Up @@ -81,6 +86,40 @@ When it is all done, it should look similar to this:
</html>
```

### MediaPlayerFactory Setup

Create a video element somewhere in your html and provide the path to your `mpd` file as src. Also ensure that your video element has the `dashjs-player` class applied to it.
```html
<video class="dashjs-player" autoplay src="http://dash.edgesuite.net/envivio/EnvivioDash3/manifest.mpd" controls="true">
</video>

```

Add dash.all.min.js to the end of the body. And add an `onload` attribute to the body element.
```html
<body onload="dashjs.MediaPlayerFactory.createAll()">
...
<script src="yourPathToDash/dash.all.min.js"></script>
</body>
```

When it is all done, it should look similar to this:
```html
<!doctype html>
<html>
<head>
<title>Dash.js Rocks</title>
</head>
<body onload="dashjs.MediaPlayerFactory.createAll()">
<div>
<video class="dashjs-player" autoplay src="http://dash.edgesuite.net/envivio/EnvivioDash3/manifest.mpd" controls="true">
</video>
</div>
<script src="yourPathToDash/dash.all.min.js"></script>
</body>
</html>
```


## Tested With

Expand Down

0 comments on commit fb49ac0

Please sign in to comment.