forked from jbuck/peerbind
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex2.html
66 lines (55 loc) · 2.28 KB
/
index2.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
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>A Peer Bind Example</title>
<script src="http://code.jquery.com/jquery-1.4.4.js"></script>
<script src="jQuery.peerbind.js"></script>
<script src="https://raw.github.com/kvz/phpjs/master/functions/strings/get_html_translation_table.js"></script>
<script src="https://raw.github.com/kvz/phpjs/master/functions/strings/htmlentities.js"></script>
<script src="http://popcornjs.org/code/dist/popcorn-complete.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var options = {
//Leaving as is allows for localhost / Local LAN IP to be used allowing empty string is in the todo
'endpointprefixes': [""],
//Set to your url, IP, or localhost (for local testing), moving port to config on the todo
'endpoint': "192.168.2.1:8080",
//string, geo, ip, url
'type': "string",
//Required for type: string only
'regstring': "PeerBindChatExample",
//Required only for geo
'coords': {
lat: 0,
long: 0
},
'coordsSet': false, //to remove - unused
//Polling interval in milliseconds
'pollinterval': 500,
'pollmax': 31000,
//Callback function to be called after registration with the server.
'regcallback': null
};
document.addEventListener("DOMContentLoaded", function () {
var popcorn = Popcorn( "#video" );
popcorn.mute();
$("#timeline").peerbind( options, "addEvent", function(e) {
console.log( "HI WE SENT YOU AN EVENT AND YOU LIKED IT" );
popcorn.play();
popcorn.timeline(options);
});
});
/*$("#video").peerbind( options, "play", {});*/
});
</script>
</head>
<body onload="" id="stage" class="theme">
<video id="video" width="0px" height="0px" class="video-js" controls>
<source src="http://192.168.2.1/~jon/peerbind/atultroll.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<source src="http://192.168.2.1/~jon/peerbind/atultroll.webm" type='video/webm; codecs="vp8, vorbis"' />
</video>
<div id="timeline" style="width:500px;height:700px;"></div>
</body>
</html>