Embed: WebRTC: allow config of ICE Servers

This commit is contained in:
Cat 2021-04-23 15:34:34 +02:00 committed by Thulinma
parent 099e2d1a58
commit 632e64ae6b
2 changed files with 9 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -263,7 +263,14 @@ p.prototype.build = function (MistVideo,callback) {
MistVideo.log("Beware: this device does not seem to be able to play H264."); MistVideo.log("Beware: this device does not seem to be able to play H264.");
}).finally(function(){ }).finally(function(){
thisWebRTCPlayer.signaling = new WebRTCSignaling(thisWebRTCPlayer.on_event); thisWebRTCPlayer.signaling = new WebRTCSignaling(thisWebRTCPlayer.on_event);
thisWebRTCPlayer.peerConn = new RTCPeerConnection(); var opts = {};
if (MistVideo.options.RTCIceServers) {
opts.iceServers = MistVideo.options.RTCIceServers;
}
else if (MistVideo.source.RTCIceServers) {
opts.iceServers = MistVideo.source.RTCIceServers;
}
thisWebRTCPlayer.peerConn = new RTCPeerConnection(opts);
thisWebRTCPlayer.peerConn.ontrack = function(ev) { thisWebRTCPlayer.peerConn.ontrack = function(ev) {
video.srcObject = ev.streams[0]; video.srcObject = ev.streams[0];
if (callback) { callback(); } if (callback) { callback(); }