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

Can't play local MP4 files

5 Answers 183 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Pete
Top achievements
Rank 1
Pete asked on 03 Mar 2014, 10:13 AM
hi,
tried everything to play local MP4 files in media player, but can't get it to happen.

Added to web.config:
​<staticContent>
<remove fileExtension=".mp4" />
<remove fileExtension=".ogv" />
<remove fileExtension=".webm" />
<remove fileExtension=".mp3" />
<remove fileExtension=".ogg" />
<remove fileExtension=".wav" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
<mimeMap fileExtension=".mp3" mimeType="audio/mpeg" />
<mimeMap fileExtension=".ogg" mimeType="audio/ogg" />
<mimeMap fileExtension=".wav" mimeType="audio/wav" />
</staticContent>

tried various paths, and the sample code from Telerik, but I just can't get them to play. I can play a youtube video without a problem, but not local files.

Code is:-
​RadMediaPlayer1.ToolbarDocked = true;
RadMediaPlayer1.ToolBar.FullScreenButton.Visible = true;
RadMediaPlayer1.ToolBar.HDButton.Visible = true;
RadMediaPlayer1.Source = filename;
RadMediaPlayer1.Title = title;
RadMediaPlayer1.Skin = Session["Skin"].ToString();
RadMediaPlayer1.AutoPlay = true;

Filename is passed through, and could be a youtube URL or a path such as ~/App_Documents/FindACosta.mp4

Thanks

Pete

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Mar 2014, 07:56 AM
Hi Pete,

Please have a look into the sample code snippet which works fine at my end and also take a look into this forum thread which discuss about the same scenario.

C#:
RadMediaPlayer RadMediaPlayer1 = new RadMediaPlayer();
RadMediaPlayer1.Width = 700;
RadMediaPlayer1.Height = 500;
RadMediaPlayer1.Source = "../Videos/RadControls.mp4";
this.form1.Controls.Add(RadMediaPlayer1);

Thanks,
Shinu.
0
Pete
Top achievements
Rank 1
answered on 04 Mar 2014, 10:07 AM
Hi,
sorry - this doesn't seem to work for me - firefox just seems to spin its wheels.

I have sent you the project in an email


Thanks

Pete
0
Eyup
Telerik team
answered on 06 Mar 2014, 08:31 AM
Hello Pete,

Can you please verify whether your sample source works as expected with regular HTML5 video tag?
http://www.w3schools.com/html/html5_video.asp

Looking forward to your reply.

Regards,
Eyup
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

0
Eric
Top achievements
Rank 1
answered on 21 Apr 2015, 09:52 PM

Hello,

 

Please make sure that .mp4 is configured to be an available MIME type in IIS.  To add it in IIS 7

 

1.  Select your website in IIS.

2.  Select "MIME Types" under the IIS section in the middle.

3.  Click "Add..." and do ".mp4" for the File name extention and "video/mp4" for the MIME type.

 

Save it and give it another try!

0
Eyup
Telerik team
answered on 24 Apr 2015, 07:14 AM
Hi Eric,

Thank you for sharing this approach with our community. You can also check the option to add mimeSettings in the web.Config file:
http://www.telerik.com/help/aspnet-ajax/mediaplayer-getting-started.html

Regards,
Eyup
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
MediaPlayer
Asked by
Pete
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pete
Top achievements
Rank 1
Eyup
Telerik team
Eric
Top achievements
Rank 1
Share this question
or