Interface ICast
A domain for interacting with Cast, Presentation API, and Remote Playback API functionalities.
[Experimental("BIDICDP001")]
public interface ICast
Properties
IssueUpdated
This is fired whenever the outstanding issue/error message changes. |issueMessage| is empty if there is no issue.
IEventSource<IssueUpdatedEventArgs> IssueUpdated { get; }
Property Value
- IEventSource<IssueUpdatedEventArgs>
Remarks
Event args (IssueUpdatedEventArgs):
- IssueMessage
SinksUpdated
This is fired whenever the list of available sinks changes. A sink is a device or a software surface that you can cast to.
IEventSource<SinksUpdatedEventArgs> SinksUpdated { get; }
Property Value
- IEventSource<SinksUpdatedEventArgs>
Remarks
Event args (SinksUpdatedEventArgs):
- Sinks
Methods
DisableAsync(string?, CancellationToken)
Stops observing for sinks and issues.
Task<DisableResult> DisableAsync(string? session = null, CancellationToken cancellationToken = default)
Parameters
sessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<DisableResult>
A task representing the asynchronous operation, containing a DisableResult.
EnableAsync(string?, string?, CancellationToken)
Starts observing for sinks that can be used for tab mirroring, and if set, sinks compatible with |presentationUrl| as well. When sinks are found, a |sinksUpdated| event is fired. Also starts observing for issue messages. When an issue is added or removed, an |issueUpdated| event is fired.
Task<EnableResult> EnableAsync(string? presentationUrl = null, string? session = null, CancellationToken cancellationToken = default)
Parameters
presentationUrlstringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<EnableResult>
A task representing the asynchronous operation, containing a EnableResult.
SetSinkToUseAsync(string, string?, CancellationToken)
Sets a sink to be used when the web page requests the browser to choose a sink via Presentation API, Remote Playback API, or Cast SDK.
Task<SetSinkToUseResult> SetSinkToUseAsync(string sinkName, string? session = null, CancellationToken cancellationToken = default)
Parameters
sinkNamestringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<SetSinkToUseResult>
A task representing the asynchronous operation, containing a SetSinkToUseResult.
StartDesktopMirroringAsync(string, string?, CancellationToken)
Starts mirroring the desktop to the sink.
Task<StartDesktopMirroringResult> StartDesktopMirroringAsync(string sinkName, string? session = null, CancellationToken cancellationToken = default)
Parameters
sinkNamestringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<StartDesktopMirroringResult>
A task representing the asynchronous operation, containing a StartDesktopMirroringResult.
StartTabMirroringAsync(string, string?, CancellationToken)
Starts mirroring the tab to the sink.
Task<StartTabMirroringResult> StartTabMirroringAsync(string sinkName, string? session = null, CancellationToken cancellationToken = default)
Parameters
sinkNamestringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<StartTabMirroringResult>
A task representing the asynchronous operation, containing a StartTabMirroringResult.
StopCastingAsync(string, string?, CancellationToken)
Stops the active Cast session on the sink.
Task<StopCastingResult> StopCastingAsync(string sinkName, string? session = null, CancellationToken cancellationToken = default)
Parameters
sinkNamestringsessionstringOptional CDP session override.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- Task<StopCastingResult>
A task representing the asynchronous operation, containing a StopCastingResult.