-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathindex-h264.html
41 lines (37 loc) · 1.19 KB
/
index-h264.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="jMuxer - a simple javascript mp4 muxer for non-standard streaming communications protocol">
<meta name="keywords" content="h264 player, mp4 player, mse, mp4 muxing, jmuxer, aac player">
<title>JMuxer demo</title>
</head>
<body>
<div id="container" style="width: 400px; margin: 0 auto;">
<video width="400" controls autoplay poster="images/loader-thumb.jpg" id="player"></video>
</div>
<script>
window.onload = function () {
var socketURL = 'ws://localhost:8081/ws';
var jmuxer = new JMuxer({
node: 'player',
fps: 30,
flushingTime: 1,
mode: 'video',
debug: true
});
var ws = new WebSocket(socketURL);
ws.binaryType = 'arraybuffer';
ws.addEventListener('message', function (event) {
jmuxer.feed({
video: new Uint8Array(event.data)
});
});
ws.addEventListener('error', function (e) {
console.log('Socket Error');
});
}
</script>
<script type="text/javascript" src="jmuxer.min.js"></script>
</body>
</html>