Issue with HTML5 audio control in Visual Studio 2010 and ASP.NET MVC - asp.net

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?

You have to upload the song to a server, for some reason firefox can't play the song if it's on the localhost, try to upload the file to some host like toofiles and get the url and use it as src
example:
<audio autoplay="autoplay" controls="controls" >
<source src="http://dl.toofiles.com/vaaoje/audios/rooster.ogg" type="audio/ogg" />
<source src="http://dl.toofiles.com/vaaoje/audios/rooster.mp3" type="audio/mpeg"/>
</audio>
the ogg file is for firefox and the mp3 file for chrome and IE.

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

Try it in chrome, it should work.
I had the very same issue with firefox.
what DTD your page declares?

Related

amp-audio problem in loading mp3 file completely

I'm currently facing an issue with AMP-audio.
When i open the page that has an mp3 file it works for the first 5 mints and then it go to the end of the mp3 file directly.
i'm wondering, is there any thing that i can do to prevent that, or this is a network issue?
my code is like this
<amp-audio width="auto"
height="50"
src="1.mp3"
preload="auto"
autoplay
controlsList="nodownload">
<div fallback>
<p>Your browser doesn’t support HTML5 audio</p>
</div>
</amp-audio>
Thanks in advance .

Opera natively plays WMV files?

I was working on playing videos in HTML5 and displaying other content instead if the browser cannot play the video. I was looking at the results in Opera, and it played a WMV! I was really surprised. My installation of Opera is a fresh install with no extensions. It doesn't play if I try it the normal way, but when using an ashx handler and sending the content as MP4, it works!
It does not work if I change it to the correct MIME type for WMV files.
VideoHandler.ashx
' load file above and get bytes (the file is a WMV)
Dim bytes As Byte() = file.FileBytes
context.Response.ContentType = "video/mp4" ' yes, I send it as an MP4
context.Response.OutputStream.Write(bytes, 0, bytes.Length)
HTML5 (my content is added dynamically using ASP.NET, but I'll simplify it here)
<video id="video" src="~/VideoHandler.ashx?&filesource=somesource&token=123456789" controls>
Video preview not available
</video>
My question is essentially, how is this working?
I couldn't find any articles by searching that would indicate that Opera can play a WMV. This method doesn't play the WMV in Chrome, Firefox, or IE11.
Note: I know that my "Video preview not available" content doesn't actually display on browsers that can't play the video, but this is unrelated to my question.

I'm trying to play a video on a website I'm making. It will play in HTML5, but doesn't play using ASP.net. What am I missing?

I've created code for HTML5 identical to that which I use in ASP, but the video never loads. It's like it's never found; there's just an empty video player sitting there on the scree. The same code works just fine in HTML. Here's the code I used for both (minus the asp tags in HTML):
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<video width="960" controls>
<source src="Printer_network_config.mp4" type="video/mp4">
</video>
</asp:Content>
Any ideas why the video doesn't play? Nothing I've found online helps; it's all just proper syntax and what tags to use.
I've viewed the page source in the browser, but it apparently can't find the video file;
Resolution: I neglected to properly close the source tag. Small and simple things.
Be sure to close ALL tags. Especially the source tag.

Can't stream AAC file with HTML5 on iOS Safari

I'm trying to embed this stream in to an HTML5 audio tag to be targeted at iOS mobile safari users: http://cjzn.streamon.fm/listen.m3u
After searching around I discovered that you can't embed M3U files directly with an HTML5 audio tag. So I saved that M3U file and opened it up, and it's only contents were:
http://cjzn.streamon.fm:8000/CJZN-48k.aac?starttime=1372879409
My next logical step was to try and embed that AAC file in to the audio tag, like so:
<audio src="http://cjzn.streamon.fm:8000/CJZN-48k.aac", autoplay="true"></audio>
But I still can't seem to get it working. Can anyone help me out?
As well, taking a step back to the M3U file - would it be smarter to try and use an M3U parser and convert the file in to a playlist that an audio player like jPlayer could play? What's the best option for me here? All I want to do is embed this stream in to my mobile Safari app.
At the moment AAC+ giving headache when it comes to Flash and HTML5. But actually you can link your M3U file from your Safari web app.
Steps -
Just create M3U file and upload it to your web server.
Then put a HTML link to that M3U file.
Example : <a href="playlist.m3u'>Play Stream</a>
All Apple devices will play that stream. I checked mine with Ipad, Iphone and Ipod touch.
I hope this will help you. Good luck !

how to embed and share MP3 file?

I've got a my own website and I've put on my website a radio interview (MP3 file). On my website there is a tool which takes the MP3 file and plays it.
My file URL is "http://www.abc.com/invterview/July 9 interview.MP3"
Now, another website wants to play the same file and asks me to give te embed/share link.
Can someone help me how to accomplish this link?
I googled and found this webpage http://www.labnol.org/internet/design/html-embed-mp3-songs-podcasts-music-in-blogs-websites/2232/ ,which explains how to accomplish an EMBED, but I've never done this and I know Chrome, IE, FF, Safari have it's own instructions...
So can someone guide me how to accomplish an EMBED URL so it will work on all Browser?
Do I need to use or what is the common use??????
if it was video file I could upload it to Youtube and send that link, but this is a MP3 file.
thanks
You could use HTML5, which has native support for playing audio.
<audio controls="controls" height="100" width="100">
<source src="song.mp3" type="audio/mp3" />
<source src="song.ogg" type="audio/ogg" />
<embed height="100" width="100" src="song.mp3" />
</audio>
If a browser does not support HTML5, the code above will fallback to the embed code.
Other than that, you could use the yahoo media player. It's not the coolest or best around, but it's simple and it gets the job done.
Play Song
<script type="text/javascript" src="http://mediaplayer.yahoo.com/js">
</script>

Resources