Esempio n. 1
0
 public IRTCRtpSender AddTrack(IMediaStreamTrack track, IMediaStream stream) =>
 RTCRtpSender.Create(JsRuntime, JsRuntime.CallJsMethod <JsObjectRef>(NativeObject, "addTrack",
                                                                     new object[]
 {
     ((MediaStreamTrack)track).NativeObject,
     ((MediaStream)stream).NativeObject
 }));
Esempio n. 2
0
        public IRTCRtpSender[] GetSenders()
        {
            var jsObjectRefGetSenders      = JsRuntime.CallJsMethod <JsObjectRef>(NativeObject, "getSenders");
            var jsObjectRefRtpSendersArray = JsRuntime.GetJsPropertyArray(jsObjectRefGetSenders);
            var rtpSenders = jsObjectRefRtpSendersArray
                             .Select(jsObjectRef => RTCRtpSender.Create(JsRuntime, jsObjectRef))
                             .ToArray();

            JsRuntime.DeleteJsObjectRef(jsObjectRefGetSenders.JsObjectRefId);
            return(rtpSenders);
        }