Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganization of Dash.js Samples #2636

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30,602 changes: 21,120 additions & 9,482 deletions package-lock.json

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions samples/audio-only/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Audio only stream example</title>

<script src="../../dist/dash.all.debug.js"></script>
<!--dash.all.min.js should be used in production over dash.all.debug.js
Debug files are not compressed or obfuscated making the file size much larger compared with dash.all.min.js-->
<!--<script src="../../dist/dash.all.min.js"></script>-->

<script class="code">
function init() {
var video,
player,
url = "https://vm2.dashif.org/dash/vod/testpic_2s/audio.mpd";

video = document.querySelector("video");
player = dashjs.MediaPlayer().create();
player.initialize(video, url, true);
}
</script>

<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div>
<video controls="true">
</video>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
init();
});
</script>
<script src="../highlighter.js"></script>
</body>
</html>


3 changes: 2 additions & 1 deletion samples/captioning/caption_vtt.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Debug files are not compressed or obfuscated making the file size much larger compared with dash.all.min.js-->
<!--<script src="../../dist/dash.all.min.js"></script>-->

<script>
<script class="code">
function startVideo() {
var url = "https://dash.akamaized.net/akamai/test/caption_test/ElephantsDream/elephants_dream_480p_heaac5_1.mpd",
video = document.querySelector(".dash-video-player video"),
Expand All @@ -34,4 +34,5 @@
<video controls="true"></video>
</div>
</body>
<script src="../highlighter.js"></script>
</html>
5 changes: 3 additions & 2 deletions samples/captioning/multi-track-captions.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Debug files are not compressed or obfuscated making the file size much larger compared with dash.all.min.js-->
<!--<script src="../../dist/dash.all.min.js"></script>-->

<script>
<script class="code">
var EXTERNAL_CAPTION_URL = "https://dash.akamaized.net/dash264/TestCases/4b/qualcomm/1/ED_OnDemand_5SecSeg_Subtitles.mpd", // need to manually seek to get stream to start... issue with MPD but only sample with multi adaptations for external sidecar caption text xml
FRAGMENTED_CAPTION_URL = "https://vm2.dashif.org/dash/vod/testpic_2s/multi_subs.mpd",
videoElement,
Expand Down Expand Up @@ -47,7 +47,7 @@
</style>

<body onload="startVideo()">
<div class="dash-video-player">
<div class="dash-video-player code">
<div class="videoContainer" id="videoContainer">
<video preload="auto" autoplay="true" > </video>
<div id="ttml-rendering-div"></div>
Expand Down Expand Up @@ -83,5 +83,6 @@
</div>
</div>
</div>
<script src="../highlighter.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions samples/captioning/ttml-ebutt-sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!--<script src="../../dist/dash.all.min.js"></script>-->


<script>
<script class="code">
/* TEST CONTENT.
https://vm2.dashif.org/dash/vod/testpic_2s/multi_subs.mpd
https://vm2.dashif.org/dash/vod/testpic_2s/stpp_two_regions_multi_color.mpd
Expand Down Expand Up @@ -51,7 +51,7 @@
</style>

<body onload="startVideo()">
<div class="dash-video-player">
<div class="dash-video-player code">
<div class="videoContainer" id="videoContainer">
<video preload="auto" autoplay="true" > </video>
<div id="ttml-rendering-div"></div>
Expand Down Expand Up @@ -87,5 +87,6 @@
</div>
</div>
</div>
<script src="../highlighter.js"></script>
</body>
</html>
53 changes: 53 additions & 0 deletions samples/drm/clearkey.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Clearkey DRM instantiation example</title>

<script src="../../dist/dash.all.debug.js"></script>
<!--dash.all.min.js should be used in production over dash.all.debug.js
Debug files are not compressed or obfuscated making the file size much larger compared with dash.all.min.js-->
<!--<script src="../../dist/dash.all.min.js"></script>-->

<script class="code">
function init() {
const protData = {
"org.w3.clearkey": {
"clearkeys": {
"nrQFDeRLSAKTLifXUIPiZg": "FmY0xnWCPCNaSpRG-tUuTQ"
}
}
};
var video,
player,
url = "https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_ClearKey.mpd";

video = document.querySelector("video");
player = dashjs.MediaPlayer().create();
player.initialize(video, url, true);
player.setProtectionData(protData);
}
</script>

<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div >
<video controls="true">
</video>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
init();
});
</script>
<script src="../highlighter.js"></script>
</body>
</html>


54 changes: 54 additions & 0 deletions samples/drm/playready.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Playready DRM instantiation example</title>

<script src="../../dist/dash.all.debug.js"></script>
<!--dash.all.min.js should be used in production over dash.all.debug.js
Debug files are not compressed or obfuscated making the file size much larger compared with dash.all.min.js-->
<!--<script src="../../dist/dash.all.min.js"></script>-->

<script class="code">
function init() {
const protData = {
"com.microsoft.playready": {
"serverURL": "https://drm-playready-licensing.axtest.net/AcquireLicense",
"httpRequestHeaders": {
"X-AxDRM-Message": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiMDg3Mjc4NmUtZjllNy00NjVmLWEzYTItNGU1YjBlZjhmYTQ1IiwiZW5jcnlwdGVkX2tleSI6IlB3NitlRVlOY3ZqWWJmc2gzW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prod.net/TestVectors/v7-MultiDRM-MultiKey-MultiPeriod/Manifest.mpd";

video = document.querySelector("video");
player = dashjs.MediaPlayer().create();
player.initialize(video, url, true);
player.setProtectionData(protData);
}
</script>

<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div>
<video controls="true">
</video>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
init();
});
</script>
<script src="../highlighter.js"></script>
</body>
</html>


54 changes: 54 additions & 0 deletions samples/drm/widevine.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Widevine DRM instantiation example</title>

<script src="../../dist/dash.all.debug.js"></script>
<!--dash.all.min.js should be used in production over dash.all.debug.js
Debug files are not compressed or obfuscated making the file size much larger compared with dash.all.min.js-->
<!--<script src="../../dist/dash.all.min.js"></script>-->

<script class="code">
function init() {
const protData = {
"com.widevine.alpha": {
"serverURL": "https://drm-widevine-licensing.axtest.net/AcquireLicense",
"httpRequestHeaders": {
"X-AxDRM-Message": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU"
}
}
};
var video,
player,
url = "https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd";

video = document.querySelector("video");
player = dashjs.MediaPlayer().create();
player.initialize(video, url, true);
player.setProtectionData(protData);
}
</script>

<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div>
<video controls="true">
</video>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
init();
});
</script>
<script src="../highlighter.js"></script>
</body>
</html>


Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,29 @@
</style>
</head>
<body>
<div>
<div class="code">
<video autoplay controls>
<source src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" type="application/dash+xml"/>
</video>
<br/>This is a dash.js player that should autostart<p/>
<br/>This is a dash.js player that should autostart
</div>
<div>
<div class="code">
<video autoplay controls="true">
<source src="http://mediapm.edgesuite.net/ovp/content/test/video/spacealonehd_sounas_640_300.mp4" type="video/mp4"/>
</video>
<br/>This is a standard mp4 (non-dash)<p/>
<br/>This is a standard mp4 (non-dash)
</div>
<div>
<div class="code">
<video poster="http://mediapm.edgesuite.net/will/dash/temp/poster.png" controls="true">
<source src="https://dash.akamaized.net/digitalprimates/fraunhofer/480p_video/heaac_2_0_with_video/Sintel/sintel_480p_heaac2_0.mpd" type="application/dash+xml"/>
</video>
<br/>This is a dash.js player that should not autostart<p/>
<br/>This is a dash.js player that should not autostart
</div>
<div>
<div class="code">
<video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls="true">
</video>
<br/>This is a dash.js player that where the manifest is defined via the src attribute of the video element.
</div>
<script src="../highlighter.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
</style>
</head>
<body>
<div>
<video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls="true"/>
<div class="code">
<video data-dashjs-player autoplay src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" controls="true"></video>
</div>
<script src="../highlighter.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Debug files are not compressed or obfuscated making the file size much larger compared with dash.all.min.js-->
<!--<script src="../../dist/dash.all.min.js"></script>-->

<script>
<script class="code">
var player;

function init()
Expand All @@ -31,19 +31,20 @@
</style>
</head>
<body>
<div>
<div class="code">
<video class="dashjs-player" autoplay controls>
<source src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" type="application/dash+xml"/>
</video>
</div>
<div>
<span id="stats"/>
<div class="code">
<span id="stats"></span>
</div>

<script>
document.addEventListener("DOMContentLoaded", function () {
init();
});
</script>
<script src="../highlighter.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
</style>
</head>
<body>
<div>
<div class="code">
<video autoplay preload="none" controls="true">
<source src="https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd" type="application/dash+xml"/>
</video>
</div>
<script src="../highlighter.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Debug files are not compressed or obfuscated making the file size much larger compared with dash.all.min.js-->
<!--<script src="../../dist/dash.all.min.js"></script>-->

<script>
<script class="code">
function init() {
var video,
player,
Expand All @@ -29,14 +29,15 @@
</style>
</head>
<body>
<div>
<div class="code">
<video controls="true">
</video>
</div>
<script>
<script class="code">
document.addEventListener("DOMContentLoaded", function () {
init();
});
</script>
<script src="../highlighter.js"></script>
</body>
</html>