views:

43

answers:

1

When MediaElement is unable to play a media file then it displays the error "Could not open mediaFile someFile.avi". Can we customize this Error message or display a link instead of message so when user clicks on it will be redirected to player site.

Edit: I am creating custom MediaPlayer and updating the requirement onApplyTemplate as below:

 public class CustomMediaPlayer : MediaPlayer
    {
     public override void OnApplyTemplate()
            {
                  base.OnApplyTemplate();
                  //..
                  //..Other Controls and Events
                  MediaElement mediaElement = GetTemplateChild("mediaElement") as MediaElement;  
                  mediaElement.MediaFailed += (obj, Args) =>
                      {
                       //Code Goes Here

                      };

           }
}
+1  A: 

You could attach to the MediaFailed event hide the MediaElement and display whatever UI content you like.

AnthonyWJones