Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 111 lines (85 sloc) 3.275 kb
4597f77 @juzna cleaned html page and added more stability
authored
1 <html><body onload="lazyStart();">
ac532c9 @juzna added videoSize attribute, fixed crashing on exit, refactored, cleane…
authored
2 <object id="testPlugin" type="application/x-linphone" width="1" height="1" onload="alert('The plugin has loaded!');">
6a189d5 @juzna added basic support for starting main thread
authored
3 <param name="onload" value="pluginCB" />
aee1ecd @juzna better locking + processing of plugin parameters
authored
4
5 <param name="enableVideo" value="1" />
6 <param name="enableVideoPreview" value="1" />
7583f4c @juzna getting window id should be platform independent now
authored
7 <param name="embedVideo" value="1" />
aee1ecd @juzna better locking + processing of plugin parameters
authored
8
9 <param name="autoStart" value="0" />
6194068 @juzna fixed autoaccept
authored
10 <param name="autoAccept" value="1" />
aee1ecd @juzna better locking + processing of plugin parameters
authored
11
12 <param name="username" value="571891103" />
13 <param name="password" value="dummypass1A" />
14 <param name="server" value="sip.helemik.cz" />
6a189d5 @juzna added basic support for starting main thread
authored
15 </object>
1068f6d @juzna allowed embedding video into plugin
authored
16 <hr style="visibility: hidden;" />
6a189d5 @juzna added basic support for starting main thread
authored
17
fe46473 @juzna added separate video window, but just empty now
authored
18 <object id="testVideo" type="application/x-linphone" width="1" height="1">
19 <param name="pluginType" value="video" />
20 </object>
21
6a189d5 @juzna added basic support for starting main thread
authored
22 <script language="javascript">
c326d90 @juzna added event handlers to html file
authored
23 var el, t1;
24
d2570c1 @juzna page fixed to work without firebug
authored
25 if(!window.console) console = {};
26 if(!console.log) console.log = function() {};
003d5dd @juzna simplified html page
authored
27
c326d90 @juzna added event handlers to html file
authored
28 el = window.el = document.getElementById('testPlugin');
fe46473 @juzna added separate video window, but just empty now
authored
29 vid = window.vid = document.getElementById('testVideo');
c326d90 @juzna added event handlers to html file
authored
30
31 el.addEventListener('globalStateChanged', function(state, msg) {
32 console.log('Global state changed:', state, msg);
33 });
34
35 el.addEventListener('registrationStateChanged', function(state, msg) {
36 console.log('Reg state changed:', state, msg);
37 });
38
39 el.addEventListener('callStateChanged', function(call, state, msg) {
40 console.log('Call state changed:', call, state, msg);
41 window.c = call;
42 });
43
44 el.addEventListener('authInfoRequested', function(user, realm) {
45 console.log('Auth info requested for', user, realm);
46 });
47
e7b2b65 @juzna small stability fixes
authored
48 el.addEventListener('windowAttached', function(id) {
49 console.log("Attached window:", id);
50 });
51
4597f77 @juzna cleaned html page and added more stability
authored
52 function lazyStart() {
53 // Because it crashes, when starting video before the window is displayed properly
54 window.setTimeout('completeStart()', 500);
55 }
56
c326d90 @juzna added event handlers to html file
authored
57 function completeStart() {
58 console.log('Init:', el.init());
ac532c9 @juzna added videoSize attribute, fixed crashing on exit, refactored, cleane…
authored
59
60 // Window size
e7b2b65 @juzna small stability fixes
authored
61 el.width = el.videoSize.width;
62 el.height = el.videoSize.height;
ac532c9 @juzna added videoSize attribute, fixed crashing on exit, refactored, cleane…
authored
63
f489362 @juzna removed hardcoded settings
authored
64 // Setup
65 el.enableLogs("/tmp/linphone-js.log");
66 el.enableStun("stun.helemik.cz");
ac532c9 @juzna added videoSize attribute, fixed crashing on exit, refactored, cleane…
authored
67
68 // Start it
c326d90 @juzna added event handlers to html file
authored
69 console.log('Start:', el.start());
70 }
71
003d5dd @juzna simplified html page
authored
72 function quit() {
73 console.log("Quit:", el.quit());
74 el.width = 1;
75 el.height = 1;
76 }
77
4597f77 @juzna cleaned html page and added more stability
authored
78 function startCall() {
79 var dst = document.getElementById('dst').value;
80 console.log("Calling ", dst);
81 console.log("Result: ", el.call(dst));
82 }
83
003d5dd @juzna simplified html page
authored
84
6a189d5 @juzna added basic support for starting main thread
authored
85 </script>
86
ac532c9 @juzna added videoSize attribute, fixed crashing on exit, refactored, cleane…
authored
87 <!--
6a189d5 @juzna added basic support for starting main thread
authored
88 <input type="button" onclick="alert(el.running);" value="Running?" />
89 <input type="button" onclick="alert(el.init());" value="Init" />
90 <input type="button" onclick="alert(el.start());" value="Start" />
91 <input type="button" onclick="alert(el.quit());" value="Quit" />
b984a84 @juzna added authentication, accept and terminate call features
authored
92 <br />
93
94 <input type="button" onclick='el.addAuthInfo("571891103", "\"ipbx\"", "dummypass1A")' value="Set auth info" />
95 <input type="button" onclick="el.addProxy('sip:sip.helemik.cz', 'sip:571891103@sip.helemik.cz')" value="Add proxy" />
96 <input type="button" onclick="alert(el.registered);" value="Registered?" />
ac532c9 @juzna added videoSize attribute, fixed crashing on exit, refactored, cleane…
authored
97 -->
c326d90 @juzna added event handlers to html file
authored
98 <input type="button" onclick="completeStart();" value="Start" />
003d5dd @juzna simplified html page
authored
99 <input type="button" onclick="quit();" value="Quit" />
b984a84 @juzna added authentication, accept and terminate call features
authored
100 <br />
101
102 <input type="button" onclick="el.accept()" value="Accept call" />
103 <input type="button" onclick="el.terminate()" value="Terminate call" />
104 <br />
105
4597f77 @juzna cleaned html page and added more stability
authored
106 <div>
107 Call:
108 <input type="text" id="dst" value="571891104">
109 <input type="button" onclick="startCall()" value="Call" />
110 </div>
Something went wrong with that request. Please try again.