IMediaReceiversRetrieveAsync Method (PredicateIMediaReceiver) |
Namespace: DotNetBrowser.Cast
Task<IMediaReceiver> RetrieveAsync( Predicate<IMediaReceiver> predicate )
Exception | Condition |
---|---|
ReceiverNotDiscoveredException | When the receiver has not been discovered within 45 seconds. |
If a matching receiver has already been discovered, returns it immediately.
Example of usage:
browser.Cast.StartPresentationHandler = new AsyncHandler<StartPresentationParameters, StartPresentationResponse>(async p => { IMediaReceiver mediaReceiver = await p.MediaReceivers .RetrieveAsync(receiver => receiver.Name.Contains("Samsung TV")); return StartPresentationResponse.Start(mediaReceiver); });