aboutsummaryrefslogtreecommitdiff
path: root/template/assemblies/player/dash.phtml
blob: 54f685c872fe0117a2c1b2278e90f88ab8e05959 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<script type="text/javascript" src="<?=h($assets)?>clapprio/dash-shaka-playback.min.js"></script>
<script type="text/javascript" src="<?=h($assets)?>clapprio/level-selector.min.js"></script>
<script type="text/javascript" src="<?=h($assets)?>clapprio/audio-selector.min.js"></script>

<div class="dashContainer">
	<div id="player"></div>
</div>

<!--
 this is an experimental hack, trying to protect the remaining page from
 interference with the new dash-player.
-->
<script type="text/javascript">
	var hasWebM = document.createElement('video').canPlayType('video/webm') != "";
	var player = new Clappr.Player({
			source: hasWebM ? '<?=h($room->getDashManifestUrl())?>' : '<?=h($room->getHLSPlaylistUrl())?>',
			width: "100%",
			plugins: [DashShakaPlayback, LevelSelector, AudioSelector],
			shakaConfiguration: {
				abr: {
					defaultBandwidthEstimate: 600000
				},
				streaming: {
					rebufferingGoal: 12,
					jumpLargeGaps: true
				}
			},
			levelSelectorConfig: {
				labels: {
					// HLS
					0: 'Slides',
					1: 'SD',
					2: 'HD',

					// DASH
					7: 'HD',
					8: 'SD',
					9: 'Slides',
					10: 'HD',
					11: 'SD',
					12: 'Slides',
					13: 'HD',
					14: 'SD',
					15: 'Slides',
				}
			},
			autoPlay: true,
			parentId: '#player'
		});
</script>


<style type="text/css">
#player > [data-player] {
	padding-bottom: 56.25%;
	height: auto !important;
}
body.room .player-wrap.tab-content {
	padding: 0;
}
</style>