Beispiel #1
0
 public static IMediaStream Create(IJSRuntime jsRuntime) =>
 new MediaStream(jsRuntime, jsRuntime.CreateJsObject("window", "MediaStream"));
Beispiel #2
0
        public static IRTCPeerConnection Create(IJSRuntime jsRuntime, RTCConfiguration rtcConfiguration)
        {
            var jsObjectRef = jsRuntime.CreateJsObject("window", "RTCPeerConnection");

            return(new RTCPeerConnection(jsRuntime, jsObjectRef, rtcConfiguration));
        }
Beispiel #3
0
        //// TODO: REFACTOR WHOLE BLAZOR API BY USING System.Private.Runtime.InteropServices.JavaScript and use HostObject.
        //private readonly JSObject _jsObjectMediaRecorder;
        ////private readonly IMediaStream _stream;
        ////private readonly MediaRecorderOptions _options;

        //public MediaRecorder(IMediaStream stream, MediaRecorderOptions options)
        //{
        //_stream = stream;
        //_options = options;
        //_jsObjectMediaRecorder = new HostObject("MediaRecorder");
        //}

        public static IMediaRecorder Create(IJSRuntime jsRuntime, IMediaStream stream, MediaRecorderOptions options)
        {
            var jsObjectRef = jsRuntime.CreateJsObject("window", "MediaRecorder", stream.NativeObject, options);

            return(new MediaRecorder(jsRuntime, jsObjectRef, stream, options));
        }