Assembly: System.Windows (in System.Windows.dll)
A developer can respond in one of four ways to a GetSampleAsync call:
Call ReportGetSampleProgress. This informs the MediaElement that the MediaStreamSource is rebuilding its buffer and it will not report samples on any stream until the buffer has has finished rebuilding. Calling ReportGetSampleProgress also permits the MediaElement to transition to the Buffering state, which will pause rendering. A developer can call ReportGetSampleProgress repeatedly to update the download percentage returned by MediaElement.BufferingProgress.
Call ReportGetSampleCompleted with a media sample or an end-of-stream sample for the requested stream. Calling ReportGetSampleCompleted on any stream also indicates buffering is complete for the media and rescinds permission to be in the Buffering state.
Call ErrorOccurred or raise an exception to indicate the media has failed.
Do nothing immediately, but eventually respond in one of the above three ways.
The Silverlight runtime only calls one MediaStreamSource callback at a time. Therefore, developers should quickly exit , failing to do so could prevent Silverlight from requesting samples for other streams, reporting state changes, etc.
Silverlight will respond to ReportGetSampleCompleted with another until the buffer for the given stream is full. Silverlight may request several samples from one stream before requesting samples from another stream. For more information on buffer management, see the “Buffering Management” section of the Implementing MediaStream Sources.
Silverlight for Windows PhoneSilverlight may call for other streams even after a developer has called ReportGetSampleProgress to indicate the MediaStreamSource is rebuilding its buffer. In this scenario, developers should be careful not to call ReportGetSampleCompleted until all buffering is completed.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.