Exemple #1
0
        public async ValueTask <MediaStreamTrack> Clone()
        {
            var objRef = await JsRuntime.InvokeInstanceMethodGetRef(JsObjectRef, "clone")
                         .ConfigureAwait(false);

            var obj = await JsRuntime.GetInstanceContent <MediaStreamTrack>(objRef, SerializationSpec)
                      .ConfigureAwait(false);

            obj.SetJsRuntime(JsRuntime, objRef);
            return(obj);
        }
Exemple #2
0
        /// <summary>
        /// loads the specified resource into the browsing context (window, &lt;iframe&gt; or tab) with the specified name. If the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.
        /// </summary>
        /// <param name="url">URL of the resource to be loaded. This can be a path or URL to an HTML page, image file, or any other resource which is supported by the browser. If the empty string ("") is specified as url, a blank page is opened into the targeted browsing context.</param>
        /// <param name="windowName">the name of the browsing context (window,  &lt;iframe&gt; or tab) into which to load the specified resource; if the name doesn't indicate an existing context, a new window is created and is given the name specified by windowName.</param>
        /// <param name="windowFeature">comma-separated list of window features given with their corresponding values in the form "name=value". These features include options such as the window's default size and position, whether or not to include scroll bars, and so forth. There must be no whitespace in the string.</param>
        /// <returns></returns>
        public async ValueTask <WindowInterop> Open(Uri url, string windowName  = null,
                                                    WindowFeature windowFeature = null)
        {
            var windowOpenRef = await JsRuntime.InvokeInstanceMethodGetRef(JsObjectRef, "open", url, windowName,
                                                                           windowFeature?.GetOpenString());

            var windowInterop = await JsRuntime.GetInstanceContent <WindowInterop>(windowOpenRef, SerializationSpec);

            windowInterop.SetJsRuntime(JsRuntime, windowOpenRef);
            return(windowInterop);
        }