(desc)
| 110 | |
| 111 | // TODO: this implicitly creates video elements, is that deseriable? |
| 112 | setRemoteDescription(desc) { |
| 113 | return this.driver.executeAsyncScript(function(desc) { |
| 114 | const callback = arguments[arguments.length - 1]; |
| 115 | |
| 116 | pc.ontrack = function(event) { |
| 117 | const id = event.streams[0].id; |
| 118 | if (document.getElementById('video-' + id)) { |
| 119 | return; |
| 120 | } |
| 121 | const video = document.createElement('video'); |
| 122 | video.id = 'video-' + id; |
| 123 | video.autoplay = true; |
| 124 | video.srcObject = event.streams[0]; |
| 125 | document.body.appendChild(video); |
| 126 | }; |
| 127 | pc.setRemoteDescription(new RTCSessionDescription(desc)) |
| 128 | .then(callback, callback); |
| 129 | }, desc); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | module.exports = { |
no outgoing calls
no test coverage detected