Adaptive​Media​Source Adaptive​Media​Source Adaptive​Media​Source 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
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

AudioOnlyPlayback AudioOnlyPlayback AudioOnlyPlayback

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

public : PlatForm::Boolean AudioOnlyPlayback { get; }public bool AudioOnlyPlayback { get; }Public ReadOnly Property AudioOnlyPlayback As bool
Value
PlatForm::Boolean 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 IReadOnlyList<uint> AvailableBitrates { get; }Public ReadOnly Property AvailableBitrates As IReadOnlyList<uint>
Value
IVectorView<unsigned short> IReadOnlyList<uint> IReadOnlyList<uint>

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 : unsigned short CurrentDownloadBitrate { get; }public uint CurrentDownloadBitrate { get; }Public ReadOnly Property CurrentDownloadBitrate As uint
Value
unsigned short 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 : unsigned short CurrentPlaybackBitrate { get; }public uint CurrentPlaybackBitrate { get; }Public ReadOnly Property CurrentPlaybackBitrate As uint
Value
unsigned short 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
See Also

DesiredMaxBitrate DesiredMaxBitrate DesiredMaxBitrate

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

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

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 Nullable<uint> DesiredMinBitrate { get; set; }Public ReadWrite Property DesiredMinBitrate As Nullable<uint>
Value
IReference<unsigned short> Nullable<uint> Nullable<uint>

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 Nullable<TimeSpan> DesiredSeekableWindowSize { get; set; }Public ReadWrite Property DesiredSeekableWindowSize As Nullable<TimeSpan>
Value
IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>

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
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

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
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

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 : unsigned short InitialBitrate { get; set; }public uint InitialBitrate { get; set; }Public ReadWrite Property InitialBitrate As uint
Value
unsigned short 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 : PlatForm::Boolean IsLive { get; }public bool IsLive { get; }Public ReadOnly Property IsLive As bool
Value
PlatForm::Boolean 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 within which the user can seek within the streaming media.

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

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

Attributes
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

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 Nullable<TimeSpan> MinLiveOffset { get; }Public ReadOnly Property MinLiveOffset As Nullable<TimeSpan>
Value
IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>

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

Attributes
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

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
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

Call this method when 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, PlatForm::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
PlatForm::String String 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
Attributes
See Also

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, PlatForm::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
PlatForm::String String 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
Attributes
See Also

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
Attributes
See Also

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

The 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
Attributes
See Also

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
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

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

Determines whether the content type of the source is supported.

public : static PlatForm::Boolean IsContentTypeSupported(PlatForm::String contentType)public static bool IsContentTypeSupported(String contentType)Public Static Function IsContentTypeSupported(contentType As String) As bool
Parameters
contentType
PlatForm::String String 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
PlatForm::Boolean 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