IMediaReceiversRetrieveAsync Method (PredicateIMediaReceiver, TimeSpan) |
Namespace: DotNetBrowser.Cast
Task<IMediaReceiver> RetrieveAsync( Predicate<IMediaReceiver> predicate, TimeSpan timeout )
Exception | Condition |
---|---|
ReceiverNotDiscoveredException | When the receiver has not been discovered within timeout. |
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"), timeout); return StartPresentationResponse.Start(mediaReceiver); });