Skip to content

Dash.js with Peer5 for DASH integration




Dash.js is an open source DASH player.

The integration with Peer5 plugin is as easy as it can get.
In addition to the player script, include the Peer5 client and the Peer5 dash.js plugin.

Peer5 client and plugins scripts

Add these two scripts to the head of your player's page

1
2
<script src="//api.peer5.com/peer5.js?id=PEER5_API_KEY"></script>
<script src="//api.peer5.com/peer5.dash.plugin.js"></script>

Complete Example

The following information needs to be filled according to your actual data:

  • PEER5_API_KEY   your Peer5 API key
  • MANIFEST_FILE   url to your .mpd file
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Dash.js Player test</title>
    <!-- peer5 client & plugin -->
    <script src="//api.peer5.com/peer5.js?id=PEER5_API_KEY"></script>
    <script src="//api.peer5.com/peer5.dashjs.plugin.js"></script>

    <!-- Dash.js script -->
    <script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>

</head>
<body>
    <video data-dashjs-player autoplay src="MANIFEST_FILE" controls></video>
</body>
</html>

Visit the full Dash.js docs here