forked from elalemanyo/thumbnail-webvtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.php
38 lines (37 loc) · 1018 Bytes
/
player.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
$opts = [
// 'input' => 'http://www.medien-tube.de/images/media/34958SD.mp4', // long
// 'input' => 'http://www.medien-tube.de/images/media/34955.mp4', // short
'input' => 'http://www.medien-tube.de/images/media/34658.mp4', // shorter
'name' => 'video',
];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test | Thumbnail & associated WebVTT file generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://content.jwplatform.com/libraries/iGrCEbaN.js"></script>
<style type="text/css">
#video {
margin: 50px auto 0 auto;
}
</style>
</head>
<body>
<div id="video"></div>
<script>
var playerInstance = jwplayer("video");
playerInstance.setup({
file: "<?=$opts['input']?>",
image: "<?=$opts['name']?>-poster.jpg",
width: "50%",
aspectratio: "16:9",
tracks: [{
file: "<?=$opts['name']?>.vtt",
kind: "thumbnails"
}]
});
</script>
</body>
</html>