This is a migrated thread and some comments may be shown as answers.

Failed to open media! when run on web

1 Answer 115 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Varakorn Klaiklang
Top achievements
Rank 1
Varakorn Klaiklang asked on 18 Feb 2011, 05:48 PM
I use this code and use F5 for test output it work as normal like picture "P2" but i copy folder SilverlightIntro.Web to my web site it error was appare like picture "P3". could you give me some advice please?

<

 

 

UserControl x:Class="SilverlightIntro.MainPage"

 

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

 

 

 

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

 

 

 

mc:Ignorable="d"

 

 

 

d:DesignHeight="300" d:DesignWidth="400" BorderThickness="10" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

 

 

 

 

<telerik:RadMediaPlayer Name="radMediaPlayer1">

 

 

<

 

 

telerik:RadMediaItem Source="http://www.itknowledgesale.com/wmv/sql2008r2.wmv"/>

 

 

 

 

</telerik:RadMediaPlayer>

 

 

</

 

 

UserControl>

 

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 23 Feb 2011, 04:52 PM
Hi Varakorn Klaiklang,

Basically RadMediaPlayer is a wrapper around Silverlight's MediaElement. The "Failed to open media." error is a generic error and the causes for it can be numerous, ranging from unsupported file format (all the supported formats you can find here) to cross domain issue. Try narrowing down the cause for the issue and sharing the information with us. You can debug your media exceptions if you handle the MediaElement.MediaFailed exception.
void MediaItem_Loaded(object sender, RoutedEventArgs e)
{
    radMediaPlayer.MediaElement.MediaFailed += new EventHandler<ExceptionRoutedEventArgs>(MediaElement_MediaFailed);
}
  
void MediaElement_MediaFailed(object sender, ExceptionRoutedEventArgs e)
{
}
This way we will be better able to assist you.

Best wishes,
Tina Stancheva
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
MediaPlayer
Asked by
Varakorn Klaiklang
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or