Table of Contents

Method CastContent

Namespace
DotNetBrowser.Cast
Assembly
DotNetBrowser.dll

CastContent(IMediaReceiver)

Starts casting the browser content to IMediaReceiver.

Task<ICastSession> CastContent(IMediaReceiver receiver)

Parameters

receiver IMediaReceiver

media receiver for casting.

Returns

Task<ICastSession>

The task that represents the result of the asynchronous start of the cast session. If the cast session has not been started, the task is completed with CastSessionStartFailedException. If the browser is closed during the casting start,the task will be canceled.

Remarks

In case when the web page has the default JavaScript PresentationRequest:

const presentationRequest = new PresentationRequest(['receiver/index.html']);
    navigator.presentation.defaultRequest = presentationRequest;

The presentation of the media content specified in this request is started instead of casting the browser content. This implies that the receiver should Supports(CastMode, PresentationRequest) support the presentation as a media source. Otherwise, if there is no default JavaScript PresentationRequest, the receiver should Supports(CastMode, PresentationRequest) support any browser's content as Browser media source.

Exceptions

MediaRoutingException

The media routing switch was not set for IEngine.