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)


public enum SmoothStreamingMediaElementState

Member nameDescription
Supported by Windows PhoneClosedThe 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.
Supported by Windows PhoneOpeningThe 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.
Supported by Windows PhoneBufferingThe 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.
Supported by Windows PhonePlayingThe SmoothStreamingMediaElement is playing the media specified by its Source or SmoothStreamingSource property. The Position advances.
Supported by Windows PhonePausedThe 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.
Supported by Windows PhoneStoppedThe 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.
Supported by Windows PhoneIndividualizingThe 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.
Supported by Windows PhoneAcquiringLicenseThe 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.
Supported by Windows PhoneClipPlayingThe media resource has been interrupted and the SmoothStreamingMediaElement is playing a clip scheduled by using ScheduleClip(ClipInformation, ClipContext, Object) or one of its overloads.

For more information and code scenarios, see Microsoft Smooth Streaming Client 2.0.

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";
    }

Silverlight

Supported in: 5

Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
Show: