38 lines
1.4 KiB
HTML
38 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
|
|
<script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>
|
|
<!-- <script src="https://cdnjs.cloudflare.com/polyfill/v2/polyfill.min.js?features=es6,Array.prototype.includes,CustomEvent,Object.entries,Object.values,URL"></script> -->
|
|
<script src="https://unpkg.com/plyr@3"></script>
|
|
<link rel="stylesheet" href="https://cdn.plyr.io/3.7.8/plyr.css" />
|
|
|
|
<style>
|
|
.container {
|
|
margin: 50px auto;
|
|
max-width: 1500px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<video controls playsinline></video>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const source = 'https://bitmovin-a.akamaihd.net/content/sintel/sintel.mpd';
|
|
const dash = dashjs.MediaPlayer().create();
|
|
const video = document.querySelector('video');
|
|
dash.initialize(video, source, true);
|
|
|
|
const player = new Plyr(video, {captions: {active: true, update: true}});
|
|
window.player = player;
|
|
window.dash = dash;
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |