|
1 | | - |
2 | 1 | <img src="https://cloud.githubusercontent.com/assets/2762250/7824984/985c3e76-03bc-11e5-807b-1402bde4fe56.png" width="400"> |
3 | 2 |
|
4 | | -[Join #dashjs on Slack!](https://join.slack.com/t/dashif/shared_invite/zt-egme869x-JH~UPUuLoKJB26fw7wj3Gg) |
5 | | - |
6 | | -## Migration from v3.x to v4.0 |
7 | | -If you are migrating from dash.js v3.x to dash.js v4.x please read the migration document found [here](https://github.com/Dash-Industry-Forum/dash.js/wiki/Migration-to-dash.js-4.0). |
8 | | - |
9 | 3 | ## Overview |
10 | | -A reference client implementation for the playback of MPEG DASH via JavaScript and [compliant browsers](http://caniuse.com/#feat=mediasource). Learn more about DASH IF Reference Client on our [wiki](https://github.com/Dash-Industry-Forum/dash.js/wiki). |
11 | | - |
12 | | -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. |
13 | | - |
14 | | -If your goal is to improve or extend the code and contribute back to this project, then you should make your changes in, and submit a pull request against, the DEVELOPMENT branch. Read our [CONTRIBUTION.md](https://github.com/Dash-Industry-Forum/dash.js/blob/development/CONTRIBUTING.md) file for a walk-through of the contribution process. |
15 | | - |
16 | | -All new work should be in the development branch. Master is now reserved for tagged builds. |
17 | | - |
18 | | -## Demo and reference players |
19 | | -All these reference builds and minified files are available under both http and https. |
20 | | - |
21 | | -### Samples |
22 | | -Multiple [dash.js samples](https://reference.dashif.org/dash.js/latest/samples/index.html) covering a wide set of common use cases. |
23 | | - |
24 | | -### Reference players |
25 | | -The released [pre-built reference players ](http://reference.dashif.org/dash.js/) if you want direct access without writing any Javascript. |
26 | | - |
27 | | -The [nightly build of the /dev branch reference player](http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html), is pre-release but contains the latest fixes. It is a good place to start if you are debugging playback problems. |
28 | | - |
29 | | - |
30 | | -### CDN hosted files |
31 | | -The latest minified files have been hosted on a global CDN and are free to use in production: |
32 | | - |
33 | | -- [dash.all.min.js](http://cdn.dashjs.org/latest/dash.all.min.js) |
34 | | -- [dash.all.debug.js](http://cdn.dashjs.org/latest/dash.all.debug.js) |
35 | | - |
36 | | -In addition, all the releases are available under the following urls. Replace "vx.x.x" with the release version, for instance "v3.1.0". |
37 | | - |
38 | | -- [http://cdn.dashjs.org/vx.x.x/dash.all.min.js](http://cdn.dashjs.org/v3.1.0/dash.all.min.js) |
39 | | -- [http://cdn.dashjs.org/vx.x.x/dash.all.debug.js](http://cdn.dashjs.org/v3.1.0/dash.all.debug.js) |
40 | | - |
41 | 4 |
|
| 5 | +dash.js is a JavaScript based implementation for the playback of MPEG DASH content in browser based |
| 6 | +environments that support the [Media Source Extensions](https://w3c.github.io/media-source/) and |
| 7 | +the [Encrypted Media Extensions](https://www.w3.org/TR/encrypted-media/). |
42 | 8 |
|
43 | 9 | ## Documentation |
44 | | -Full [API Documentation](http://cdn.dashjs.org/latest/jsdoc/module-MediaPlayer.html) is available describing all public methods, interfaces, properties, and events. |
45 | | - |
46 | | -For help, join our [Slack channel](https://dashif-slack.azurewebsites.net), our [email list](https://groups.google.com/d/forum/dashjs) and read our [wiki](https://github.com/Dash-Industry-Forum/dash.js/wiki). |
47 | | - |
48 | | -## Tutorials |
49 | 10 |
|
50 | | -Detailed information on specific topics can be found in our tutorials: |
| 11 | +To get started, check out our [documentation](https://dashif.org/dash.js/) that includes |
| 12 | +a [quickstart guide](https://dashif.org/dash.js/pages/quickstart/index.html) , [usage instructions](https://dashif.org/dash.js/pages/usage/index.html) |
| 13 | +and [contribution guidelines](https://dashif.org/dash.js/pages/developers/how-to-contribute.html). |
51 | 14 |
|
52 | | -* [Low latency streaming](https://github.com/Dash-Industry-Forum/dash.js/wiki/Low-Latency-streaming) |
53 | | -* [UTCTiming Clock synchronization](https://github.com/Dash-Industry-Forum/dash.js/wiki/UTCTiming---Clock-synchronization) |
54 | | -* [Digital Rights Management (DRM) and license acquisition](https://github.com/Dash-Industry-Forum/dash.js/wiki/Digital-Rights-Management-(DRM)-and-license-acquisition) |
55 | | -* [Buffer and scheduling logic](https://github.com/Dash-Industry-Forum/dash.js/wiki/Buffer-and-Scheduling-Logic) |
| 15 | +## Hosted Examples |
56 | 16 |
|
57 | | -## Getting Started |
| 17 | +* [Reference Player](https://reference.dashif.org/dash.js/latest/samples/dash-if-reference-player/index.html) |
| 18 | +* [Samples](https://reference.dashif.org/dash.js/latest/samples/index.html) |
58 | 19 |
|
59 | | -The standard setup method uses javascript to initialize and provide video details to dash.js. `MediaPlayerFactory` provides an alternative declarative setup syntax. |
| 20 | +## Quickstart |
60 | 21 |
|
61 | | -### Standard Setup |
| 22 | +A very basic example on how to use dash.js in your application can be found below: |
62 | 23 |
|
63 | | -Create a video element somewhere in your html. For our purposes, make sure the controls attribute is present. |
64 | | -```html |
65 | | -<video id="videoPlayer" controls></video> |
66 | | -``` |
67 | | -Add dash.all.min.js to the end of the body. |
68 | | -```html |
69 | | -<body> |
70 | | - ... |
71 | | - <script src="yourPathToDash/dash.all.min.js"></script> |
72 | | -</body> |
73 | | -``` |
74 | | -Now comes the good stuff. We need to create a MediaPlayer and initialize it. |
75 | | -``` js |
76 | | - |
77 | | -var url = "https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd"; |
78 | | -var player = dashjs.MediaPlayer().create(); |
79 | | -player.initialize(document.querySelector("#videoPlayer"), url, true); |
80 | | - |
81 | | -``` |
82 | | - |
83 | | -When it is all done, it should look similar to this: |
84 | 24 | ```html |
85 | 25 | <!doctype html> |
86 | 26 | <html> |
87 | | - <head> |
88 | | - <title>Dash.js Rocks</title> |
89 | | - <style> |
90 | | - video { |
91 | | - width: 640px; |
92 | | - height: 360px; |
93 | | - } |
94 | | - </style> |
95 | | - </head> |
96 | | - <body> |
97 | | - <div> |
98 | | - <video id="videoPlayer" controls></video> |
99 | | - </div> |
100 | | - <script src="yourPathToDash/dash.all.min.js"></script> |
101 | | - <script> |
102 | | - (function(){ |
103 | | - var url = "https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd"; |
104 | | - var player = dashjs.MediaPlayer().create(); |
105 | | - player.initialize(document.querySelector("#videoPlayer"), url, true); |
106 | | - })(); |
107 | | - </script> |
108 | | - </body> |
| 27 | +<head> |
| 28 | + <title>dash.js Rocks</title> |
| 29 | + <style> |
| 30 | + video { |
| 31 | + width: 640px; |
| 32 | + height: 360px; |
| 33 | + } |
| 34 | + </style> |
| 35 | +</head> |
| 36 | +<body> |
| 37 | +<div> |
| 38 | + <video id="videoPlayer" controls></video> |
| 39 | +</div> |
| 40 | +<script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script> |
| 41 | +<script> |
| 42 | + (function () { |
| 43 | + var url = "https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd"; |
| 44 | + var player = dashjs.MediaPlayer().create(); |
| 45 | + player.initialize(document.querySelector("#videoPlayer"), url, true); |
| 46 | + })(); |
| 47 | +</script> |
| 48 | +</body> |
109 | 49 | </html> |
110 | 50 | ``` |
111 | 51 |
|
112 | | -### Module Setup |
113 | | - |
114 | | -We publish dash.js to [npm](https://www.npmjs.com/package/dashjs). Examples of how to use dash.js in different module |
115 | | -bundlers can be found in the [`samples/modules`](https://github.com/Dash-Industry-Forum/dash.js/tree/development/samples/modules) directory. |
116 | | - |
117 | | -### MediaPlayerFactory Setup |
118 | | - |
119 | | -An alternative way to build a Dash.js player in your web page is to use the MediaPlayerFactory. The MediaPlayerFactory will automatically instantiate and initialize the MediaPlayer module on appropriately tagged video elements. |
120 | | - |
121 | | -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 `data-dashjs-player` attribute on it. |
122 | | -```html |
123 | | -<video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls> |
124 | | -</video> |
| 52 | +## Contact |
125 | 53 |
|
126 | | -``` |
| 54 | +Please raise any issue directly on [Github](https://github.com/Dash-Industry-Forum/dash.js/issues). |
127 | 55 |
|
128 | | -Add dash.all.min.js to the end of the body. |
129 | | -```html |
130 | | -<body> |
131 | | - ... |
132 | | - <script src="yourPathToDash/dash.all.min.js"></script> |
133 | | -</body> |
134 | | -``` |
| 56 | +You can also find us on [Slack!](https://join.slack.com/t/dashif/shared_invite/zt-egme869x-JH~UPUuLoKJB26fw7wj3Gg) and |
| 57 | +on [Google Groups](https://groups.google.com/g/dashjs). |
135 | 58 |
|
136 | | -When it is all done, it should look similar to this: |
137 | | -```html |
138 | | -<!doctype html> |
139 | | -<html> |
140 | | - <head> |
141 | | - <title>Dash.js Rocks</title> |
142 | | - <style> |
143 | | - video { |
144 | | - width: 640px; |
145 | | - height: 360px; |
146 | | - } |
147 | | - </style> |
148 | | - </head> |
149 | | - <body> |
150 | | - <div> |
151 | | - <video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls> |
152 | | - </video> |
153 | | - </div> |
154 | | - <script src="yourPathToDash/dash.all.min.js"></script> |
155 | | - </body> |
156 | | -</html> |
157 | | -``` |
| 59 | +## License |
158 | 60 |
|
159 | | -## Quick Start for Developers |
160 | | - |
161 | | -1. Install Core Dependencies |
162 | | - * [install nodejs](http://nodejs.org/) |
163 | | -2. Checkout project repository (default branch: development) |
164 | | - * ```git clone https://github.com/Dash-Industry-Forum/dash.js.git``` |
165 | | -3. Install dependencies |
166 | | - * ```npm install``` |
167 | | -4. Build, watch file changes and launch samples page, which has links that point to reference player and to other examples (basic examples, captioning, ads, live, etc). |
168 | | - * ```npm run start``` |
169 | | - |
170 | | - |
171 | | -### Other Tasks to Build / Run Tests on Commandline. |
172 | | - |
173 | | -* Build distribution files (minification included) |
174 | | - * ```npm run build``` |
175 | | -* Build and watch distribution files |
176 | | - * ```npm run dev``` |
177 | | -* Run linter on source files (linter is also applied when building files) |
178 | | - * ```npm run lint``` |
179 | | -* Run unit tests |
180 | | - * ```npm run test``` |
181 | | -* Generate API jsdoc |
182 | | - * ```npm run doc``` |
183 | | - |
184 | | -### Troubleshooting |
185 | | -* In case the build process is failing make sure to use an up-to-date node.js version. The build process was successfully tested with node.js version 20.10.0. |
186 | | - |
187 | | -### License |
188 | 61 | dash.js is released under [BSD license](https://github.com/Dash-Industry-Forum/dash.js/blob/development/LICENSE.md) |
189 | 62 |
|
190 | | -### Tested With |
| 63 | +## Tested With |
191 | 64 |
|
192 | 65 | [<img src="https://cloud.githubusercontent.com/assets/7864462/12837037/452a17c6-cb73-11e5-9f39-fc96893bc9bf.png" alt="Browser Stack Logo" width="300">](https://www.browserstack.com/) |
193 | 66 | |
|
0 commit comments