views:

54

answers:

2

I am trying to add HTML5 audio control to my page. Here's the code:

<audio src="../../Content/BattleNet_MusicLoop.ogg" 
controls="controls" autoplay="autoplay" loop="loop">
Your browser does not support the new HTML5 audio element.
</audio>

When I click debug, I can see the audio player for about a second and then it turns dark gret with light "x" icon in the middle. I clicked on "Copy Audio Source" and the source seems to be correct. Browser is not the issue because it's a Firefox 4.0 Beta 1. It plays this exact HTML5 audio player fine on http://www.w3schools.com/html5/tag_audio.asp. That's where I got it from by the way.

I am using Visual Studio 2010 HTML5 add-in by Mikhail Arkhipov. My project is based on ASP.NET MVC 2 and .NET Framework 3.5

Any ideas what could be causing this issue?

A: 

Did you try to replace "../../Content/BattleNet_MusicLoop.ogg" with '<%= Url.Content("~/Content/BattleNet_MusicLoop.ogg") %>' ?

Mohamed Meligy
No should I? I will try your suggestion now. UPDATE: No change, same as before.
Silence of 2012
A: 

Try it in chrome, it should work. I had the very same issue with firefox.

what DTD your page declares?

Alexander Taran
I am using HTML5 <!DOCTYPE html> as shown on W3 website. I will try in Chrome and see if it works.
Silence of 2012