• Stars
    star
    5,073
  • Rank 8,201 (Top 0.2 %)
  • Language
    JavaScript
  • License
    Other
  • Created almost 12 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.

Build status (CircleCI): CircleCI

Join #dashjs on Slack!

Migration from v3.x to v4.0

If you are migrating from dash.js v3.x to dash.js v4.x please read the migration document found here.

Overview

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

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.

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 file for a walk-through of the contribution process.

All new work should be in the development branch. Master is now reserved for tagged builds.

Demo and reference players

All these reference builds and minified files are available under both http and https.

Samples

Multiple dash.js samples covering a wide set of common use cases.

Reference players

The released pre-built reference players if you want direct access without writing any Javascript.

The nightly build of the /dev branch reference player, is pre-release but contains the latest fixes. It is a good place to start if you are debugging playback problems.

CDN hosted files

The latest minified files have been hosted on a global CDN and are free to use in production:

In addition, all the releases are available under the following urls. Replace "vx.x.x" with the release version, for instance "v3.1.0".

Documentation

Full API Documentation is available describing all public methods, interfaces, properties, and events.

For help, join our Slack channel, our email list and read our wiki.

Tutorials

Detailed information on specific topics can be found in our tutorials:

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 the controls attribute is present.

<video id="videoPlayer" controls></video>

Add dash.all.min.js to the end of the body.

<body>
  ...
  <script src="yourPathToDash/dash.all.min.js"></script>
</body>

Now comes the good stuff. We need to create a MediaPlayer and initialize it.

var url = "https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd";
var player = dashjs.MediaPlayer().create();
player.initialize(document.querySelector("#videoPlayer"), url, true);

When it is all done, it should look similar to this:

<!doctype html>
<html>
    <head>
        <title>Dash.js Rocks</title>
        <style>
            video {
                width: 640px;
                height: 360px;
            }
        </style>
    </head>
    <body>
        <div>
            <video id="videoPlayer" controls></video>
        </div>
        <script src="yourPathToDash/dash.all.min.js"></script>
        <script>
            (function(){
                var url = "https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd";
                var player = dashjs.MediaPlayer().create();
                player.initialize(document.querySelector("#videoPlayer"), url, true);
            })();
        </script>
    </body>
</html>

Module Setup

We publish dash.js to npm. Examples of how to use dash.js in different module bundlers can be found in the samples/modules directory.

MediaPlayerFactory Setup

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.

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.

<video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls>
</video>

Add dash.all.min.js to the end of the body.

<body>
  ...
  <script src="yourPathToDash/dash.all.min.js"></script>
</body>

When it is all done, it should look similar to this:

<!doctype html>
<html>
    <head>
        <title>Dash.js Rocks</title>
        <style>
            video {
                width: 640px;
                height: 360px;
            }
        </style>
    </head>
    <body>
        <div>
            <video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls>
            </video>
        </div>
        <script src="yourPathToDash/dash.all.min.js"></script>
    </body>
</html>

Quick Start for Developers

  1. Install Core Dependencies
  2. Checkout project repository (default branch: development)
    • git clone https://github.com/Dash-Industry-Forum/dash.js.git
  3. Install dependencies
    • npm install
  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).
    • npm run start

Other Tasks to Build / Run Tests on Commandline.

  • Build distribution files (minification included)
    • npm run build
  • Build and watch distribution files
    • npm run dev
  • Run linter on source files (linter is also applied when building files)
    • npm run lint
  • Run unit tests
    • npm run test
  • Generate API jsdoc
    • npm run doc

Troubleshooting

  • 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 14.16.1.

License

dash.js is released under BSD license

Tested With

Browser Stack Logo

More Repositories

1

dash-live-source-simulator

DASH live source simulator providing reference live content.
Python
147
star
2

codem-isoboxer

A lightweight browser-based MPEG-4 (ISOBMFF) file/box parser.
JavaScript
114
star
3

media-tools

A collection of tools for analyzing, handling, and creating media and media containers
Python
84
star
4

DASH-IF-Conformance

This repository provides the source code for MPEG-DASH/DASH-IF Conformance Software/Validator. It has been extended according to further standards, such as CMAF, DVB-DASH, HbbTV, and CTA WAVE.
HTML
67
star
5

livesim2

DASH Live Source Simulator v2 in Go
Go
36
star
6

DASH-IF-IOP

DASH-IF Interoperability Points issue tracker and document source code
Makefile
32
star
7

ClearKey-Content-Protection

The repository holds a description and an issue tracker for how ClearKey-based content protection should be used with MPEG DASH.
28
star
8

CPIX

Shell
25
star
9

Conformance-Software

Deprecated, moved to: https://github.com/Dash-Industry-Forum/DASH-IF-Conformance
HTML
20
star
10

MPEG-Conformance-and-reference-source

Contains several MPEG reference software modules. Not actively maintained. The ISOSegmentValidator is moved to - https://github.com/Dash-Industry-Forum/ISOSegmentValidator
C++
20
star
11

Ingest

HTML
13
star
12

dash-video-element

A custom element (web component) for playing DASH (Dynamic Adaptive Streaming over Http) videos.
JavaScript
11
star
13

Guidelines-TimingModel

DASH-IF implementation guidelines: the DASH timing model
9
star
14

CMAF-Conformance

CMAF sub repository of DASH-IF-Conformance. This repo contains CTAWAVE conformance functionalities as a submodule. CTA WAVE Github project is located at https://github.com/orgs/Dash-Industry-Forum/projects/6 but it is not visible to the public. To see this page & contribute, please get in contact with repository admin to be added as a collaborator.
PHP
9
star
15

cea608.js

A JavaScript project designed to extract CEA-608 captions.
JavaScript
8
star
16

ISOSegmentValidator

C++
7
star
17

Content-Steering

A standardized means of steering DASH players between substitutable content sources by way of a remote steering server.
6
star
18

Live

Collects issues about the Live document
5
star
19

DASH

XSLT
5
star
20

Dash-Industry-Forum.github.io

Public website for DASH IF
HTML
5
star
21

Watermarking

Discussion around watermarking solutions in DASH-IF
4
star
22

Test-Content

Documents Test Content Generation
Shell
4
star
23

Test-Vectors

DASH-IF Test Vectors
4
star
24

Guidelines-Security

DASH-IF implementation guidelines: content protection and security
4
star
25

webRTC

Discussions around webRTC-based Streaming
4
star
26

cpix-test-vectors

CPIX test vectors
4
star
27

Academic-Track

3
star
28

AdInsertion

3
star
29

ATSC

Tracks bugs for DASH profile for ATSC
CSS
3
star
30

Identifiers

Collects Identifiers to be added to DASH-IF
Shell
3
star
31

CPIX-Transfer-Protocol

3
star
32

HLS

PHP
3
star
33

Test-Assets-Dataset-Public

JavaScript
3
star
34

DocumentAuthoringExample

Example document that illustrates the capabilities of the GitHub document authoring workflow and can be used as a testbench.
3
star
35

dash.js-browserstack

Spike for automated BrowserStack UATs for dash.js
JavaScript
3
star
36

Resources

Resources for each of the working groups and task forces
2
star
37

Events

Addresses discussions around Event Processing and APIs
HTML
2
star
38

DRM

Collect DRM related comments
2
star
39

SAND-Test-Vectors

Test vectors for ISO/IEC 23009-5 Server And Network assisted DASH
Python
2
star
40

dashjs.org

The public website for the dash.js project
JavaScript
2
star
41

Conformance-Frontend

Sub-module for the Integrated Conformance Software Tool
HTML
2
star
42

Codecs

Adds the registration of codecs
Shell
1
star
43

DynamicServiceValidator

JavaScript
1
star
44

MPEG

Collects issues that need to be reported to MPEG
1
star
45

SAND

Comments and Bugs against the DASH-IF SAND Documentation
1
star
46

FeatureTest

Issues corresponsing to each feature at http://testassets.dashif.org/
1
star
47

livesim-content

Test content for livesim2
HTML
1
star
48

SAND-HTTP-Conformance-Server

HTTP server validating SAND messages and the protocol used by a DASH client according to ISO/IEC 23009-5 SAND
Python
1
star
49

dash-live-source-simulator-drm-data-generator

Generates DRM test data (keys and related) for the live source simulator
PowerShell
1
star
50

SAND-HTTP-Conformance-Client

SAND client validating SAND messages sent by a SAND server, a.k.a DANE
Python
1
star
51

TAC

Token-based Authorization
1
star
52

Conformance-Frontend-HLS

Submodule of the Integrated Conformance Software Tool
HTML
1
star
53

Test-Cases

This repository collects test cases. Bugs are only closed once we have at least one test vector that covers this feature
1
star
54

HbbTV_DVB

Submodule of https://github.com/Dash-Industry-Forum/DASH-IF-Conformance
PHP
1
star
55

IOPv5

IOP v5 editing for tracking issues
1
star
56

MPEG-CENC

Discusses issues on MPEG Common Encryption
1
star