Share via


SmoothStreamingMediaElement.MediaFailed Event

Occurs when there is an error associated with the media source.

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

Syntax

'Declaration

Public Event MediaFailed As EventHandler(Of ExceptionRoutedEventArgs)
'Usage

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

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

Remarks

For more information, see Events.

Examples

The following example shows a delegate that handles the media failed event.

    void SmoothPlayer_MediaFailed(object sender, ExceptionRoutedEventArgs e)
    {
        MessageBox.Show(e.ErrorException.Message + " Inner Exception: "
            + e.ErrorException.InnerException);
    }

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