SmoothStreamingMediaElementState Enumeration
Enumeration of possible states for the SmoothStreamingMediaElement.
Namespace: Microsoft.Web.Media.SmoothStreaming
Assembly: Microsoft.Web.Media.SmoothStreaming (in Microsoft.Web.Media.SmoothStreaming.dll)
Syntax
'Declaration
Public Enumeration SmoothStreamingMediaElementState
'Usage
Dim instance As SmoothStreamingMediaElementState
public enum SmoothStreamingMediaElementState
public enum class SmoothStreamingMediaElementState
type SmoothStreamingMediaElementState
public enum SmoothStreamingMediaElementState
Members
Member name | Description | |
---|---|---|
Closed | The SmoothStreamingMediaElement contains no media. The SmoothStreamingMediaElement displays a transparent frame. A media clip can be scheduled for play by using the ScheduleClip method with the ManifestReady event. | |
Opening | The SmoothStreamingMediaElement is loading the media for playback. The Position does not advance in this state. If the SmoothStreamingMediaElement was already playing video, it continues to display the last displayed frame. | |
Buffering | The SmoothStreamingMediaElement is loading the media for playback. The Position does not advance. If the SmoothStreamingMediaElement was playing video, it continues to display the current frame. | |
Playing | The SmoothStreamingMediaElement is playing the media specified by its Source or SmoothStreamingSource property. The Position advances. | |
Paused | The SmoothStreamingMediaElement is paused. The Microsoft.Web.Media.SmoothStreaming.SmoothStreamingMediaElement.Position does not advance. If the SmoothStreamingMediaElement was playing video, it continues to display the current frame. | |
Stopped | The SmoothStreamingMediaElement contains media but is not playing or paused. The Position is 0 and does not advance. If the loaded media is video, the SmoothStreamingMediaElement displays the first frame. | |
Individualizing | The individualization components are being validated to make sure that the required components are installed. Before Silverlight requests the license to decrypt the content, Silverlight must first determine whether the end user’s computer has the appropriate DRM software installed. This software is called by the individualization component and is the client of DRM that is required before any protected content can be played. Once OnAcquireLicense(Stream, Uri) has been called, the SmoothStreamingMediaElement will remain in this state until SetLicenseResponse(Stream) has been called. | |
AcquiringLicense | The SmoothStreamingMediaElement is acquiring a license to play DRM protected content. Once OnAcquireLicense(Stream, Uri) has been called, the SmoothStreamingMediaElement will remain in this state until SetLicenseResponse(Stream) is called. | |
ClipPlaying | The media resource has been interrupted and the SmoothStreamingMediaElement is playing a clip scheduled by using ScheduleClip(ClipInformation, ClipContext, Object) or one of its overloads. |
Remarks
For more information and code scenarios, see Microsoft Smooth Streaming Client 2.0.
Examples
The logic for the Play and Stop buttons is shown in the following excerpt from the example in the topic Silverlight Applications. The Playbutton_Click delegate uses SmoothStreamingMediaElementState to set the button text and action.
private void PlayButton_Loaded(object sender, RoutedEventArgs e)
{
switch (SmoothPlayer.AutoPlay)
{
case false:
PlayButton.Content = "Play";
break;
case true:
PlayButton.Content = "Pause";
break;
}
}
private void PlayButton_Click(object sender, RoutedEventArgs e)
{
switch (SmoothPlayer.CurrentState)
{
case SmoothStreamingMediaElementState.Playing:
SmoothPlayer.Pause();
PlayButton.Content = "Play";
break;
case SmoothStreamingMediaElementState.Paused:
SmoothPlayer.Play();
PlayButton.Content = "Pause";
break;
case SmoothStreamingMediaElementState.Stopped:
SmoothPlayer.Play();
PlayButton.Content = "Pause";
break;
}
}
private void StopButton_Click(object sender, RoutedEventArgs e)
{
SmoothPlayer.Stop();
PlayButton.Content = "Play";
}
Version Information
Silverlight
Supported in: 5
Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0