Share via


MediaStreamSource.SampleRequested Event

Definition

Occurs when the MediaStreamSource request a MediaStreamSample for a specified stream.

// Register
event_token SampleRequested(TypedEventHandler<MediaStreamSource, MediaStreamSourceSampleRequestedEventArgs const&> const& handler) const;

// Revoke with event_token
void SampleRequested(event_token const* cookie) const;

// Revoke with event_revoker
MediaStreamSource::SampleRequested_revoker SampleRequested(auto_revoke_t, TypedEventHandler<MediaStreamSource, MediaStreamSourceSampleRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<MediaStreamSource,MediaStreamSourceSampleRequestedEventArgs> SampleRequested;
function onSampleRequested(eventArgs) { /* Your code */ }
mediaStreamSource.addEventListener("samplerequested", onSampleRequested);
mediaStreamSource.removeEventListener("samplerequested", onSampleRequested);
- or -
mediaStreamSource.onsamplerequested = onSampleRequested;
Public Custom Event SampleRequested As TypedEventHandler(Of MediaStreamSource, MediaStreamSourceSampleRequestedEventArgs) 

Event Type

Remarks

Upon receiving this event, the application should assign a MediaStreamSample for the requested stream to the Sample property of the MediaStreamSourceSampleRequest object.

If the application is temporarily unable to deliver the MediaStreamSample, it should obtain the MediaStreamSourceSampleRequestDeferral object and invoke ReportSampleProgress on a regular basis until it assigns a MediaStreamSample to the Sample property and calls Complete on the MediaStreamSourceSampleRequestDeferral object. The recommended interval between each invocation of ReportSampleProgress is 500 milliseconds.

If the specified stream does not have any more samples, the application should leave the Sample property unassigned or set it to null.

Applies to

See also