MediaStreamSourceStartingRequest MediaStreamSourceStartingRequest MediaStreamSourceStartingRequest MediaStreamSourceStartingRequest Class

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

Syntax

Declaration

public sealed class MediaStreamSourceStartingRequestpublic sealed class MediaStreamSourceStartingRequestPublic NotInheritable Class MediaStreamSourceStartingRequest

Remarks

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

Properties summary

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.

Methods summary

Defers completing the Starting event.

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

Properties

  • 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 IReference<TimeSpan> StartPosition { get; }Public ReadOnly Property StartPosition As IReference<TimeSpan>

    Property Value

    • 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.

    Remarks

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

Methods

  • GetDeferral()
    GetDeferral()
    GetDeferral()
    GetDeferral()

    Defers completing the Starting event.

    public MediaStreamSourceStartingRequestDeferral GetDeferral()public MediaStreamSourceStartingRequestDeferral GetDeferral()Public Function GetDeferral() As MediaStreamSourceStartingRequestDeferral

    Returns

    Remarks

    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(Windows.Foundation.TimeSpan)
    SetActualStartPosition(Windows.Foundation.TimeSpan)
    SetActualStartPosition(Windows.Foundation.TimeSpan)
    SetActualStartPosition(Windows.Foundation.TimeSpan)

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

    public void SetActualStartPosition(Windows.Foundation.TimeSpan position)public void SetActualStartPosition(Windows.Foundation.TimeSpan position)Public Function SetActualStartPosition(position As Windows.Foundation.TimeSpan) As void

    Parameters

    Remarks

    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.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute

Details

Assembly

Windows.Media.Core.dll