Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

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

For more information and code scenarios, see IIS Smooth Streaming Client 1.5.

The logic for the Play and Stop buttons is shown in the following excerpt from the example in the topic Silverlight Applications (IIS Smooth Streaming). 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: 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.0
Show:
© 2014 Microsoft. All rights reserved.