Share via


SmoothStreamingMediaElement.PlaybackTrackChanged Event

Occurs when the currently playing track changes.

Namespace:  Microsoft.Web.Media.SmoothStreaming
Assembly:  Microsoft.Web.Media.SmoothStreaming (in Microsoft.Web.Media.SmoothStreaming.dll)

Syntax

'Declaration

Public Event PlaybackTrackChanged As EventHandler(Of TrackChangedEventArgs)
'Usage

Dim instance As SmoothStreamingMediaElement
Dim handler As EventHandler(Of TrackChangedEventArgs)

AddHandler instance.PlaybackTrackChanged, handler
public event EventHandler<TrackChangedEventArgs> PlaybackTrackChanged
public:
 event EventHandler<TrackChangedEventArgs^>^ PlaybackTrackChanged {
    void add (EventHandler<TrackChangedEventArgs^>^ value);
    void remove (EventHandler<TrackChangedEventArgs^>^ value);
}
member PlaybackTrackChanged : <EventHandler<TrackChangedEventArgs>,
    TrackChangedEventArgs>
JScript supports the use of events, but not the declaration of new ones.

Remarks

For more information, see Select and Monitor Bitrate and Events.

Examples

Bit-rate changes invoke the PlaybackTrackChanged event. Applications can monitor the bitrate in the delegate that handles the event. The following example shows how to read the new bitrate from the TrackChangedEventArgs parameter and display it using a text block.

    void SmoothPlayer_PlaybackTrackChanged(object sender, TrackChangedEventArgs e)
    {
        OutputText.Text = "Current bitrate: " + e.Track.Bitrate.ToString();
    }

Version Information

Silverlight

Supported in: 5

Windows Phone

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

See Also

Reference

SmoothStreamingMediaElement Class

Microsoft.Web.Media.SmoothStreaming Namespace