AdaptiveMediaSource AdaptiveMediaSource AdaptiveMediaSource Class

Definition

Represents the source of adaptive streaming content.

public sealed class AdaptiveMediaSource : IClosable, IMediaSource, IAdaptiveMediaSource, IAdaptiveMediaSource2, IAdaptiveMediaSource3public sealed class AdaptiveMediaSource : IDisposable, IMediaSource, IAdaptiveMediaSource, IAdaptiveMediaSource2, IAdaptiveMediaSource3Public NotInheritable Class AdaptiveMediaSource Implements IDisposable, IMediaSource, IAdaptiveMediaSource, IAdaptiveMediaSource2, IAdaptiveMediaSource3
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Call one of the CreateFromStreamAsync or CreateFromUriAsync methods to create a AdaptiveMediaSource object with a specific adaptive streaming manifest source.

For how-to guidance for using adaptive streaming in your app, see Adaptive streaming.

Properties

AdvancedSettings AdvancedSettings AdvancedSettings

Gets the advanced settings for the adaptive media source.

public AdaptiveMediaSourceAdvancedSettings AdvancedSettings { get; }public AdaptiveMediaSourceAdvancedSettings AdvancedSettings { get; }Public ReadOnly Property AdvancedSettings As AdaptiveMediaSourceAdvancedSettings
Attributes

AudioOnlyPlayback AudioOnlyPlayback AudioOnlyPlayback

Gets a value indicating if the content streamed by the media source contains only audio.

public bool AudioOnlyPlayback { get; }public bool AudioOnlyPlayback { get; }Public ReadOnly Property AudioOnlyPlayback As bool
Value
bool bool bool

True if the content only contains audio; otherwise, false.

Attributes

Remarks

Check the value of this property to determine if the media content is audio-only and adjust your UI accordingly.

AvailableBitrates AvailableBitrates AvailableBitrates

Gets the available adaptive bit rates of the adaptive streaming manifest that is the source of the adaptive streaming object.

public IVectorView<uint> AvailableBitrates { get; }public IVectorView<uint> AvailableBitrates { get; }Public ReadOnly Property AvailableBitrates As IVectorView<uint>
Value

The list of available adaptive bit rates of the adaptive streaming manifest.

Attributes

CurrentDownloadBitrate CurrentDownloadBitrate CurrentDownloadBitrate

Gets a value indicating the current download bitrate for the media source.

public uint CurrentDownloadBitrate { get; }public uint CurrentDownloadBitrate { get; }Public ReadOnly Property CurrentDownloadBitrate As uint
Value
uint uint uint

The current download bitrate for the media source.

Attributes

CurrentPlaybackBitrate CurrentPlaybackBitrate CurrentPlaybackBitrate

Gets a value indicating the current playback bitrate for the media source.

public uint CurrentPlaybackBitrate { get; }public uint CurrentPlaybackBitrate { get; }Public ReadOnly Property CurrentPlaybackBitrate As uint
Value
uint uint uint

The current playback bitrate for the media source.

Attributes

DesiredLiveOffset DesiredLiveOffset DesiredLiveOffset

Gets or sets the desired offset of live playback from the end of the known media content that has been downloaded.

public TimeSpan DesiredLiveOffset { get; set; }public TimeSpan DesiredLiveOffset { get; set; }Public ReadWrite Property DesiredLiveOffset As TimeSpan
Value
TimeSpan TimeSpan TimeSpan

The desired offset for the live playback of the streaming media. This value must be greater than MinLiveOffset. If the specified value is less than the minimum value, it is automatically clamped to the allowed range.

Attributes

DesiredMaxBitrate DesiredMaxBitrate DesiredMaxBitrate

Gets or sets the desired maximum bitrate for the media source.

public IReference<uint> DesiredMaxBitrate { get; set; }public IReference<uint> DesiredMaxBitrate { get; set; }Public ReadWrite Property DesiredMaxBitrate As IReference<uint>
Value

The desired maximum bitrate for the streaming media.

Attributes

DesiredMinBitrate DesiredMinBitrate DesiredMinBitrate

Gets or sets the desired minimum bitrate for the media source.

public IReference<uint> DesiredMinBitrate { get; set; }public IReference<uint> DesiredMinBitrate { get; set; }Public ReadWrite Property DesiredMinBitrate As IReference<uint>
Value

The desired minimum bitrate for the streaming media.

Attributes

DesiredSeekableWindowSize DesiredSeekableWindowSize DesiredSeekableWindowSize

Gets or sets the requested maximum size of the time window within which the user can seek within the streaming media.

public IReference<TimeSpan> DesiredSeekableWindowSize { get; set; }public IReference<TimeSpan> DesiredSeekableWindowSize { get; set; }Public ReadWrite Property DesiredSeekableWindowSize As IReference<TimeSpan>
Value

The requested maximum size of the time window in which the user can seek within the streaming media. This value must be between zero and the value of MaxSeekableWindowSize. If the specified value is greater than the maximum value, the system automatically clamps to the allowed range, but when you retrieve the property it will return the unclamped value.

Attributes

Diagnostics Diagnostics Diagnostics

Gets an object that provides an event that is raised when diagnostic information about the adaptive media source is available.

public AdaptiveMediaSourceDiagnostics Diagnostics { get; }public AdaptiveMediaSourceDiagnostics Diagnostics { get; }Public ReadOnly Property Diagnostics As AdaptiveMediaSourceDiagnostics
Value
AdaptiveMediaSourceDiagnostics AdaptiveMediaSourceDiagnostics AdaptiveMediaSourceDiagnostics

An object that provides an event that is raised when diagnostic information about the adaptive media source is available.

Attributes

InboundBitsPerSecond InboundBitsPerSecond InboundBitsPerSecond

Gets a value indicating the inbound bits per second statistic over the time window specified by the InboundBitsPerSecondWindow property.

public ulong InboundBitsPerSecond { get; }public ulong InboundBitsPerSecond { get; }Public ReadOnly Property InboundBitsPerSecond As ulong
Value
ulong ulong ulong

The inbound bits per second over the InboundBitsPerSecondWindow time span.

Attributes

InboundBitsPerSecondWindow InboundBitsPerSecondWindow InboundBitsPerSecondWindow

Gets or sets the time span over which the InboundBitsPerSecond property is calculated.

public TimeSpan InboundBitsPerSecondWindow { get; set; }public TimeSpan InboundBitsPerSecondWindow { get; set; }Public ReadWrite Property InboundBitsPerSecondWindow As TimeSpan
Value
TimeSpan TimeSpan TimeSpan

The time span over which the InboundBitsPerSecond property is calculated.

Attributes

Remarks

The default value for this property is a time span of 5 minutes.

InitialBitrate InitialBitrate InitialBitrate

Gets and sets the initial bit rate to use for playback of the media source.

public uint InitialBitrate { get; set; }public uint InitialBitrate { get; set; }Public ReadWrite Property InitialBitrate As uint
Value
uint uint uint

The initial bit rate to use for playback.

Attributes

IsLive IsLive IsLive

Gets a value that indicates whether the media source is live.

public bool IsLive { get; }public bool IsLive { get; }Public ReadOnly Property IsLive As bool
Value
bool bool bool

A value that indicates whether playback of the adaptive streaming object is live. true if live; otherwise, false.

Attributes

MaxSeekableWindowSize MaxSeekableWindowSize MaxSeekableWindowSize

Gets the maximum time window time window within which the user can seek within the streaming media.

public IReference<TimeSpan> MaxSeekableWindowSize { get; }public IReference<TimeSpan> MaxSeekableWindowSize { get; }Public ReadOnly Property MaxSeekableWindowSize As IReference<TimeSpan>
Value

The maximum time window time window within which the user can seek within the streaming media.

Attributes

Remarks

This time window is calculated by taking the total duration of media that has been downloaded and subtracting the value of the DesiredLiveOffset property. This value is specified by the media content.

MinLiveOffset MinLiveOffset MinLiveOffset

Gets the minimum offset of live playback from the end of the known media content that has been downloaded.

public IReference<TimeSpan> MinLiveOffset { get; }public IReference<TimeSpan> MinLiveOffset { get; }Public ReadOnly Property MinLiveOffset As IReference<TimeSpan>
Value

The minimum offset of live playback from the end of the known media content that has been downloaded.

Attributes

Remarks

This property specifies the minimum value to which the DesiredLiveOffset property can be set. This value is specified by the media content or platform.

Methods

Close() Close() Close()

Closes the adaptive media source and frees up associated resources.

public void Close()This member is not implemented in C#This member is not implemented in VB.Net
Attributes

Remarks

Call this method wehn you are done with the adaptive media source, such as when switching to a different media source, to ensure that the resources are cleaned up and that network operations for this adaptive media source are stopped.

CreateFromStreamAsync(IInputStream, Uri, String) CreateFromStreamAsync(IInputStream, Uri, String) CreateFromStreamAsync(IInputStream, Uri, String)

Asynchronously creates a AdaptiveMediaSource object from the provided input stream.

public static IAsyncOperation<AdaptiveMediaSourceCreationResult> CreateFromStreamAsync(IInputStream stream, Uri uri, String contentType)public static IAsyncOperation<AdaptiveMediaSourceCreationResult> CreateFromStreamAsync(IInputStream stream, Uri uri, String contentType)Public Static Function CreateFromStreamAsync(stream As IInputStream, uri As Uri, contentType As String) As IAsyncOperation( Of AdaptiveMediaSourceCreationResult )
Parameters
stream
IInputStream IInputStream IInputStream

The input stream from which the AdaptiveMediaSource is created.

uri
Uri Uri Uri

The Uniform Resource Identifier (URI) of the source. This is used by the AdaptiveMediaSource to resolve relative URIs.

contentType
System.String System.String System.String

A string that identifies the MIME content type of the source. This can be an Http Live Streaming (HLS) or a Dynamic Adaptive Streaming over HTTP (DASH) content type.

Returns

Returns an AdaptiveMediaSourceCreationResult upon successful completion.

Attributes

CreateFromStreamAsync(IInputStream, Uri, String, HttpClient) CreateFromStreamAsync(IInputStream, Uri, String, HttpClient) CreateFromStreamAsync(IInputStream, Uri, String, HttpClient)

Asynchronously creates a AdaptiveMediaSource object from the provided input stream.

public static IAsyncOperation<AdaptiveMediaSourceCreationResult> CreateFromStreamAsync(IInputStream stream, Uri uri, String contentType, HttpClient httpClient)public static IAsyncOperation<AdaptiveMediaSourceCreationResult> CreateFromStreamAsync(IInputStream stream, Uri uri, String contentType, HttpClient httpClient)Public Static Function CreateFromStreamAsync(stream As IInputStream, uri As Uri, contentType As String, httpClient As HttpClient) As IAsyncOperation( Of AdaptiveMediaSourceCreationResult )
Parameters
stream
IInputStream IInputStream IInputStream

The input stream from which the AdaptiveMediaSource is created.

uri
Uri Uri Uri

The Uniform Resource Identifier (URI) of the source. This is used by the AdaptiveMediaSource to resolve relative URIs.

contentType
System.String System.String System.String

A string that identifies the MIME content type of the source. This can be an Http Live Streaming (HLS) or a Dynamic Adaptive Streaming over HTTP (DASH) content type.

httpClient
HttpClient HttpClient HttpClient

The HttpClient instance that the AdaptiveMediaSource should use for downloading resources. This allows you to specify custom HTTP headers for the requests.

Returns

Returns an AdaptiveMediaSourceCreationResult upon successful completion.

Attributes

CreateFromUriAsync(Uri) CreateFromUriAsync(Uri) CreateFromUriAsync(Uri)

Asynchronously creates a AdaptiveMediaSource object from the Uniform Resource Identifier (URI) of the source.

public static IAsyncOperation<AdaptiveMediaSourceCreationResult> CreateFromUriAsync(Uri uri)public static IAsyncOperation<AdaptiveMediaSourceCreationResult> CreateFromUriAsync(Uri uri)Public Static Function CreateFromUriAsync(uri As Uri) As IAsyncOperation( Of AdaptiveMediaSourceCreationResult )
Parameters
uri
Uri Uri Uri

T he Uniform Resource Identifier (URI) of the source.

Returns

Returns an AdaptiveMediaSourceCreationResult upon successful completion.

Attributes

CreateFromUriAsync(Uri, HttpClient) CreateFromUriAsync(Uri, HttpClient) CreateFromUriAsync(Uri, HttpClient)

Asynchronously creates a AdaptiveMediaSource object from the Uniform Resource Identifier (URI) of the source.

public static IAsyncOperation<AdaptiveMediaSourceCreationResult> CreateFromUriAsync(Uri uri, HttpClient httpClient)public static IAsyncOperation<AdaptiveMediaSourceCreationResult> CreateFromUriAsync(Uri uri, HttpClient httpClient)Public Static Function CreateFromUriAsync(uri As Uri, httpClient As HttpClient) As IAsyncOperation( Of AdaptiveMediaSourceCreationResult )
Parameters
uri
Uri Uri Uri

T he Uniform Resource Identifier (URI) of the source.

httpClient
HttpClient HttpClient HttpClient

The HttpClient instance that the AdaptiveMediaSource should use for downloading resources. This allows you to specify custom HTTP headers for the requests.

Returns

Returns an AdaptiveMediaSourceCreationResult upon successful completion.

Attributes

Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

This member is not implemented in C++void Dispose()Sub Dispose
Attributes

GetCorrelatedTimes() GetCorrelatedTimes() GetCorrelatedTimes()

Gets an object that provides timing information that is correlated between timestamps in the media or date/time information from the manifest with the presentation clock timeline.

public AdaptiveMediaSourceCorrelatedTimes GetCorrelatedTimes()public AdaptiveMediaSourceCorrelatedTimes GetCorrelatedTimes()Public Function GetCorrelatedTimes() As AdaptiveMediaSourceCorrelatedTimes
Returns

An object that provides correlated timing information for the adaptive media source.

Attributes

IsContentTypeSupported(String) IsContentTypeSupported(String) IsContentTypeSupported(String)

Determines whether the content type of the source is supported.

public static bool IsContentTypeSupported(String contentType)public static bool IsContentTypeSupported(String contentType)Public Static Function IsContentTypeSupported(contentType As String) As bool
Parameters
contentType
System.String System.String System.String

A string that identifies the content type of the source. Can be a Http Live Streaming (HLS) or Dynamic Adaptive Streaming over HTTP (DASH) content type.

Returns
bool bool bool

Returns a value that indicates whether the content type of the source is supported. true if supported; otherwise, false.

Attributes

Events

DownloadBitrateChanged DownloadBitrateChanged DownloadBitrateChanged

Occurs when the CurrentDownloadBitrate changes.

public event TypedEventHandler DownloadBitrateChangedpublic event TypedEventHandler DownloadBitrateChangedPublic Event DownloadBitrateChanged
Attributes

DownloadCompleted DownloadCompleted DownloadCompleted

Occurs when a resource download operation completes

public event TypedEventHandler DownloadCompletedpublic event TypedEventHandler DownloadCompletedPublic Event DownloadCompleted
Attributes

DownloadFailed DownloadFailed DownloadFailed

Occurs when a resource download operation fails.

public event TypedEventHandler DownloadFailedpublic event TypedEventHandler DownloadFailedPublic Event DownloadFailed
Attributes

DownloadRequested DownloadRequested DownloadRequested

Occurs when a resource download operation is requested.

public event TypedEventHandler DownloadRequestedpublic event TypedEventHandler DownloadRequestedPublic Event DownloadRequested
Attributes

Remarks

Handle this event to modify parameters of the resource download operation before the operation begins.

PlaybackBitrateChanged PlaybackBitrateChanged PlaybackBitrateChanged

Occurs when the CurrentPlaybackBitrate changes.

public event TypedEventHandler PlaybackBitrateChangedpublic event TypedEventHandler PlaybackBitrateChangedPublic Event PlaybackBitrateChanged
Attributes

See Also