-
Notifications
You must be signed in to change notification settings - Fork 20
/
shaka-player.html
129 lines (109 loc) · 4.95 KB
/
shaka-player.html
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Phil's Players - Shaka Player for DASH or HLS</title>
<!-- Bootstrap -->
<link href="css/bootstrap.flatly.min.css" title="default" rel="stylesheet">
<link href="css/bootstrap.darkly.min.css" title="dark" rel="stylesheet">
<link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<link href="css/jumbotron-narrow.css" rel="stylesheet">
<!-- Style Switcher -->
<script src="js/docs-themes.js" type="text/javascript"></script>
<script type="text/javascript">set_style();</script>
<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!-- Shaka Player -->
<script src="https://ajax.googleapis.com/ajax/libs/shaka-player/3.3.2/shaka-player.ui.js"></script>
<link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/shaka-player/3.3.2/controls.css">
<script defer src="https://ajax.googleapis.com/ajax/libs/shaka-player/3.3.2/mux.js"></script>
<script defer src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
<script src="js/shaka.js"></script>
<style>
@font-face {
font-family: TengwarTelcontar;
src: url("https://raw.githubusercontent.com/shaka-project/shaka-player/main/demo/TengwarTelcontar.woff2") format("woff2");
font-weight: normal;
font-style: normal;
}
.shaka-video-container * {
font-family: Roboto-Regular, Roboto, sans-serif, TengwarTelcontar;
}
</style>
</head>
<body>
<div class="container">
<div class="header clearfix">
<nav>
<ul class="nav nav-pills pull-right">
<li role="presentation"><a href="index.html">Select a Player</a></li>
<li role="presentation"><a href="#" onclick='switch_style("dark"); return false;'>Dark</a></li>
<li role="presentation"><a href="#" onclick='switch_style("default"); return false;'>Light</a></li>
</ul>
</nav>
<h3 class="text-muted">Phil's Players</h3>
</div>
<div class="jumbotron">
<form id="playform">
<div class="form-group">
<label for="manifest">DASH or HLS Manifest:</label>
<input type="text" class="form-control" id="manifest" name="manifest">
</div>
<button type="submit" class="btn btn-primary btn-lg">Play!</button><br><br>
<button type="button" id="hls-demo" class="btn btn-info btn-sm">Load Demo HLS Manifest</button>
<button type="button" id="dash-demo" class="btn btn-info btn-sm">Load Demo DASH Manifest</button>
<button type="button" id="sjn-demo" class="btn btn-info btn-sm">Load Sindarin translation</button>
</form>
</div>
<div class="jumbotron">
<div data-shaka-player-container
data-shaka-player-cast-receiver-id="BBED8D28">
<video id="video"
poster="https://shaka-player-demo.appspot.com/assets/poster.jpg"
data-shaka-player
style="width: 100%"
autoplay /></video>
</div>
</div>
<script>
$( "#playform" ).submit(function( event ) {
// Try to load a manifest.
// This is an asynchronous process.
player.load( $( "#manifest" ).val() ).then(function() {
// This runs if the asynchronous load is successful.
console.log('The video has now been loaded!');
// onPlayerError is executed if the asynchronous load fails.
}).catch(onPlayerError);
event.preventDefault();
});
$( "#dash-demo" ).click(function() {
$( "#manifest" ).val("https://d1czxfd0hfd9km.cloudfront.net/outputs/bbb/mediaconvert/dash/bbb.mpd");
$( "#playform" ).submit();
});
$( "#hls-demo" ).click(function() {
$( "#manifest" ).val("https://d1czxfd0hfd9km.cloudfront.net/outputs/bbb/mediaconvert/hls/bbb.m3u8");
$( "#playform" ).submit();
});
$( "#sjn-demo" ).click(function() {
fetch('https://raw.githubusercontent.com/shaka-project/shaka-player/main/ui/locales/sjn.json').then(function(response) {
return response.json();
}).then(function(translations) {
ui.getControls().getLocalization().insert('sjn', new Map(Object.entries(translations)));
ui.getControls().getLocalization().changeLocale(['sjn'].concat(navigator.languages));
});
});
</script>
<div class="jumbotron">
<p><small>Shaka Player v3.3.2 with UI and mux.js 5.14.1.<br><a href="https://github.com/shaka-project/shaka-player">More details can be found here.</a><small></p>
</div>
<script type='text/javascript'>
</script>
<footer class="footer">
<p>© Phil Cluff & <a href="https://github.com/philcluff/phils-players#authors"> The Authors</a>2023.</p>
</footer>
</div>
<script src="js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>