mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
139e722ce2
This is in preparation for a future in which SSL is required by EME. Change-Id: I82ef395197e27fa5cc9bcaf1afa25e27b9710935
47 lines
1.3 KiB
Plaintext
47 lines
1.3 KiB
Plaintext
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>TurtleTube - Basic Test</title>
|
|
<!-- Load the Shaka Player library. -->
|
|
<script src="shaka-player.compiled.js"></script>
|
|
</head>
|
|
<body>
|
|
<video id="video"
|
|
width="640" height="480"
|
|
crossorigin="anonymous"
|
|
controls>
|
|
Your browser does not support HTML5 video.
|
|
</video>
|
|
</body>
|
|
<script>
|
|
function initPlayer() {
|
|
// Install polyfills.
|
|
shaka.polyfill.installAll();
|
|
|
|
// Find the video element.
|
|
var video = document.getElementById('video');
|
|
|
|
// Construct a Player to wrap around it.
|
|
var player = new shaka.player.Player(video);
|
|
|
|
// Attach the player to the window so that it can be easily debugged.
|
|
window.player = player;
|
|
|
|
// Listen for errors from the Player.
|
|
player.addEventListener('error', function(event) {
|
|
console.error(event);
|
|
});
|
|
|
|
// Construct a DashVideoSource to represent the DASH manifest.
|
|
var mpdUrl = 'https://turtle-tube.appspot.com/t/t2/dash.mpd';
|
|
var estimator = new shaka.util.EWMABandwidthEstimator();
|
|
var source = new shaka.player.DashVideoSource(mpdUrl, null, estimator);
|
|
|
|
// Load the source into the Player.
|
|
player.load(source);
|
|
}
|
|
document.addEventListener('DOMContentLoaded', initPlayer);
|
|
</script>
|
|
</html>
|