OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <title>WebRTC Simulcast Test</title> | 5 <title>WebRTC Simulcast Test</title> |
6 <style> | 6 <style> |
7 video { | 7 video { |
8 border:5px solid black; | 8 border:5px solid black; |
9 } | 9 } |
10 button { | 10 button { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 function trace(text) { | 128 function trace(text) { |
129 // This function is used for logging. | 129 // This function is used for logging. |
130 if (text[text.length - 1] == '\n') { | 130 if (text[text.length - 1] == '\n') { |
131 text = text.substring(0, text.length - 1); | 131 text = text.substring(0, text.length - 1); |
132 } | 132 } |
133 console.log((performance.now() / 1000).toFixed(3) + ': ' + text); | 133 console.log((performance.now() / 1000).toFixed(3) + ': ' + text); |
134 } | 134 } |
135 | 135 |
136 function initialize() { | 136 function initialize() { |
137 trace('Setting up for a new call.'); | 137 trace('Setting up for a new call.'); |
138 var servers = null; | 138 var configs = {iceServers:[], rtcpMuxPolicy:'negotiate'}; |
139 var constraints = {'mandatory': {'DtlsSrtpKeyAgreement': false}}; | 139 var constraints = {'mandatory': {'DtlsSrtpKeyAgreement': false}}; |
140 pcClient = new webkitRTCPeerConnection(servers, constraints); | 140 pcClient = new webkitRTCPeerConnection(configs, constraints); |
141 trace('Created local peer connection object pcClient'); | 141 trace('Created local peer connection object pcClient'); |
142 pcClient.onicecandidate = onClientIceCandidate; | 142 pcClient.onicecandidate = onClientIceCandidate; |
143 pcServer = new webkitRTCPeerConnection(servers, constraints); | 143 pcServer = new webkitRTCPeerConnection(configs, constraints); |
144 trace('Created remote peer connection object pcServer'); | 144 trace('Created remote peer connection object pcServer'); |
145 pcServer.onicecandidate = onServerIceCandidate; | 145 pcServer.onicecandidate = onServerIceCandidate; |
146 pcServer.onaddstream = onServerGotStream; | 146 pcServer.onaddstream = onServerGotStream; |
147 | 147 |
148 var pcClientInitialOffer = makeClientOffer(); | 148 var pcClientInitialOffer = makeClientOffer(); |
149 trace('Setting initial local Offer to:\n' + pcClientInitialOffer); | 149 trace('Setting initial local Offer to:\n' + pcClientInitialOffer); |
150 pcClient.setLocalDescription(pcClientInitialOffer, | 150 pcClient.setLocalDescription(pcClientInitialOffer, |
151 setServerRemoteDescription); | 151 setServerRemoteDescription); |
152 } | 152 } |
153 | 153 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 throw 'Expected to run in an automated context.'; | 234 throw 'Expected to run in an automated context.'; |
235 window.domAutomationController.send(message); | 235 window.domAutomationController.send(message); |
236 } | 236 } |
237 | 237 |
238 $ = function(id) { | 238 $ = function(id) { |
239 return document.getElementById(id); | 239 return document.getElementById(id); |
240 }; | 240 }; |
241 | 241 |
242 </script> | 242 </script> |
243 </body> | 243 </body> |
OLD | NEW |