public static async Task <bool> RequestStopAsync(this IMediaStreamFacadeBase mediaStreamFacade, TimeSpan timeout, CancellationToken cancellationToken) { bool flag; using (CancellationTokenSource linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken)) { linkedTokenSource.CancelAfter(timeout); try { await mediaStreamFacade.StopAsync(linkedTokenSource.Token).ConfigureAwait(false); flag = true; goto label_10; } catch (OperationCanceledException ex) { Debug.WriteLine(!cancellationToken.IsCancellationRequested ? "RequestStop timeout" : "RequestStop canceled"); } catch (Exception ex) { Debug.WriteLine("RequestStop failed: " + ExceptionExtensions.ExtendedMessage(ex)); } flag = false; } label_10: return(flag); }
protected PlaybackSessionBase(IMediaStreamFacadeBase <TMediaSource> mediaStreamFacade) { if (null == mediaStreamFacade) { throw new ArgumentNullException("mediaStreamFacade"); } this._mediaStreamFacade = mediaStreamFacade; }
protected PlaybackSessionBase(IMediaStreamFacadeBase <TMediaSource> mediaStreamFacade) { if (null == mediaStreamFacade) { throw new ArgumentNullException(nameof(mediaStreamFacade)); } MediaStreamFacade = mediaStreamFacade; }
public PlaybackSession(IMediaStreamFacadeBase <MediaStreamSource> mediaStreamFacade) : base(mediaStreamFacade) { }
public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IMetadataSink metadataSink) { mediaStreamFacade.Builder.RegisterSingleton <IMetadataSink>(metadataSink); }
public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IHttpConnectionRequestFactoryParameters parameters) { mediaStreamFacade.Builder.RegisterSingleton <IHttpConnectionRequestFactoryParameters>(parameters); }
public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IWebReaderManagerParameters parameters) { mediaStreamFacade.Builder.RegisterSingleton <IWebReaderManagerParameters>(parameters); }
public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IApplicationInformation applicationInformation) { mediaStreamFacade.Builder.RegisterSingleton <IApplicationInformation>(applicationInformation); }
public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IMediaStreamConfigurator mediaStreamConfigurator) { mediaStreamFacade.Builder.RegisterSingleton <IMediaStreamConfigurator>(mediaStreamConfigurator); }
public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IBufferingPolicy policy) { mediaStreamFacade.Builder.RegisterSingleton <IBufferingPolicy>(policy); }
public static void RequestStop(this IMediaStreamFacadeBase mediaStreamFacade) { Task <bool> task = MediaStreamFacadeExtensions.RequestStopAsync(mediaStreamFacade, TimeSpan.FromSeconds(5.0), CancellationToken.None); TaskCollector.Default.Add((Task)task, "MediaStreamFacade RequestStop"); }
public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IUserAgent userAgent) { mediaStreamFacade.Builder.RegisterSingleton <IUserAgent>(userAgent); }