MediaStreamSourceStartingRequest MediaStreamSourceStartingRequest MediaStreamSourceStartingRequest MediaStreamSourceStartingRequest Class


Represents a request from the MediaStreamSource.Starting event for the application to start accumulating MediaStreamSample objects from a specific position in the media.

public : sealed class MediaStreamSourceStartingRequest : IMediaStreamSourceStartingRequest
public sealed class MediaStreamSourceStartingRequest : IMediaStreamSourceStartingRequest
Public NotInheritable Class MediaStreamSourceStartingRequest Implements IMediaStreamSourceStartingRequest
// This class does not provide a public constructor.
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


See the MediaStreamSource Sample for an example of using Media Stream Source in a UWP app.


StartPosition StartPosition StartPosition StartPosition

Specifies a reference to a TimeSpan object which represents a time position in the media time-line from which the application should return MediaStreamSample objects.

public : IReference<TimeSpan> StartPosition { get; }
public Nullable<TimeSpan> StartPosition { get; }
Public ReadOnly Property StartPosition As Nullable<TimeSpan>
var nullable = mediaStreamSourceStartingRequest.startPosition;
IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>

A reference that points to a TimeSpan which specifies the position in the media time-line to start sending MediaStreamSample objects. If the reference is null, the application should continue to return MediaStreamSample objects from the current position.


If StartPosition is not null, then the TimeSpan specifies the position in the media time-line from which the application should deliver MediaStreamSamples. If the reference is null, the application is not supposed to change its position and it should then continue to return MediaStreamSamples from the current position.


GetDeferral() GetDeferral() GetDeferral() GetDeferral()

Defers completing the MediaStreamSource.Starting event.

public : MediaStreamSourceStartingRequestDeferral GetDeferral()
public MediaStreamSourceStartingRequestDeferral GetDeferral()
Public Function GetDeferral() As MediaStreamSourceStartingRequestDeferral
var mediaStreamSourceStartingRequestDeferral = mediaStreamSourceStartingRequest.getDeferral();


You can use a deferral when you want to make an asynchronous call in response to the Starting event. For example, if you need to establish a HTTP connection or open a file for reading. The MediaStreamSource will then wait for you to mark the deferral as complete before it begins raising the SampleRequested event.

To create a deferral, call the GetDeferral method to instruct the MediaStreamSource to wait for your asynchronous call to complete. When you are ready to start receiving SampleRequested events, call the Complete method to end the deferral.

SetActualStartPosition(TimeSpan) SetActualStartPosition(TimeSpan) SetActualStartPosition(TimeSpan) SetActualStartPosition(TimeSpan)

Specifies the starting position in the media time-line for subsequent MediaStreamSamples that will be delivered to the MediaStreamSource.

public : void SetActualStartPosition(TimeSpan position)
public void SetActualStartPosition(TimeSpan position)
Public Function SetActualStartPosition(position As TimeSpan) As void
TimeSpan TimeSpan TimeSpan TimeSpan

The actual starting point in the media time-line chosen by the application.


The application should choose the value of position such that the values of the Timestamp property of the MediaStreamSample objects will be greater than or equal to position, for all currently selected streams.

See Also