public IRTCRtpSender AddTrack(IMediaStreamTrack track, IMediaStream stream) => RTCRtpSender.Create(JsRuntime, JsRuntime.CallJsMethod <JsObjectRef>(NativeObject, "addTrack", new object[] { ((MediaStreamTrack)track).NativeObject, ((MediaStream)stream).NativeObject }));
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); }