Dash.js with Peer5 for DASH integration¶
Dash.js is an open source DASH player.
The integration with Peer5 plugin is easy and involves just two lines of code. In addition to the player script, simply include the Peer5 client and the matching Peer5 Dash.js plugin based on your player version.
Peer5 client and plugins scripts¶
Add the following two scripts to the
head of your player's page:
<script src="//api.peer5.com/peer5.js?id=PEER5_CUSTOMER_ID"></script> <script src="//api.peer5.com/peer5.dashjs.plugin.js"></script>
The following information needs to be filled according to your actual data:
PEER5_CUSTOMER_IDyour Peer5 Customer ID
MANIFEST_FILEurl to your
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Dash.js Demo</title> <!-- Peer5 scripts --> <script src="//api.peer5.com/peer5.js?id=PEER5_CUSTOMER_ID"></script> <script src="//api.peer5.com/peer5.dashjs.plugin.js"></script> <!-- Player scripts --> <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.
To test that you integrated with Peer5 correctly, and to see stats about what the Peer5 integration is doing, you can view the stats overlay.