Audio in HTML5 Video tag - html

I noticed that using an audio file in <video> works fine.
Does this feature have good browser compatibility and is it an HTML5 standard?
I found this but it's from 7 years ago and has no answers.

Yes a <video> element is supposed to be able to play media resources that only contain audio data, just like an <audio> element is supposed to be able to play video media (without displaying the video stream).
A browser that wouldn't do that would be a buggy browser.

<video> tag supports most browsers like chrome, edge, firefox, safari, and opera.
It is a global attribute in HTML5.
For Audio you can also use <audio>.
If you want to know more there is something you can check out
https://www.w3schools.com/tags/tag_video.asp

Related

Jwplayer force Safari browser to play in HTML5 mode

I am using JWplayer 6.
I need to force it to use HTML5 even if HTML5 is not supported (this is for RESTing purposes).
I cannot figure out how to accomplish this.
I have tried setting jwplayer("playername").settings({primary: "flash"}) - it didn't work.
Right now I am resorting to disabling flash in browsers but not all browsers/devices allow this without addons.
I am using (player).getRenderingMode to determine the playback type so I am absolutely certain that only flash is being played.
Any help is appreciated!
UPDATE:
I have the primary: "flash"/"HTML5" setting working in every browser except Safari.
According to W3C schools Safari DOES support mp4 files in HTML5 mode.
So my question is now how to force Safari to play in HTML5 mode

play mp4 video in ie7,8,9 firefox, chrome and safari using the HTML5 player - possible?

Is it possible to use only a mp4 video and the HTML5 player in ie7,8,9 firefox, chrome and safari
I've seen these links
http://blog.beverlyguillermo.com/post/14813549122/ie7-and-html5-video
and
http://w3schools.com/tags/tryit.asp?filename=tryhtml5_video
and
http://designwebkit.com/web-and-trends/10-good-html5-video-players-website/
Have you ever done this
Thanks
Try this http://code.google.com/p/video4all/ . Its a nice way you can integrate with all the browsers you have listed
If you are not satisfied try the answer here :- How to play the html5 video in IE8 Browsers

Audio tag does not work in Safari or Opera

I'm having a problem playing audio in Safari or Opera. The following code does not work in either:
<audio controls>
<source src="http://fallowproduction.com/music/Paradigm%20E%20-%20Once%20upon%20a%20Dubstep2.mp3" type="audio/mpeg">
</audio>
Here's the jsFiddle for easy access to the code: http://jsfiddle.net/panq7/1/
Considering it's really simple, I'm mystified as to why. Is this a normal problem? Or is there something else going on? I looked up playing mp3 problems with Safari and while I found no solution, I found a bunch of complaints.
Edit: I fixed the Safari problem by adding an option for an embed tag. Still, it's not the ideal fix, as Safari is supposed to support the <audio> tag, which it does not, apparently (someone let me know if it works in their version of Safari). However, Opera apparently does not support the <audio> tag, or the <embed> tag. This is contrary to the browser specifications, as mentioned later by another member of StackOverflow.
Opera does support <audio> however, when using MP3, there seems to be limited support for different sampling rates. To solve this problem, I detect support for OGG and detect the Opera browser and fall back to OGG. It's not perfect because I would prefer to simply detect if there is MP3 support and go with that, however Opera reports that it does support MP3, so it's not enough to just check that.
You could also simply use supported MP3 formats for Opera. I believe the following is supported:
32kHz/44.1kHz/48kHz frequencies,
16kbps-10Mbps bitrate
The reason may be the missing closed tag /> in source line.
Wolfgang

HTML5 <audio> element not showing up in Firefox on Mac

http://fowlertown.com/projects/terry/widgets/audio.html
Or if you don't want to click the link, here is the code that matters:
<audio type="audio/mpeg; codecs='mp3'" controls src="sample.mp3">Your browser does not support the HTML5 <audio> element.</audio>
This isn't showing up in Firefox 15.0.1 and 16.0.1 on Mac OS X 10.7.4 which depresses me because this is crazy simple HTML5 code. It pops up for a fleeting moment on load but then disappears. It doesn't even show the fallback text.
Thoughts? Is it working for Windows users?
edit: http://html5doctor.com/html5-audio-the-state-of-play/ is where I got my browser support list, which indicates FF has supported the audio element (MP3 codec) since version 3.6.
You have to use this tag differently as in firefox you can't play MP3 files with such a code.
Here is the link for your help. http://support.mozilla.org/en-US/questions/758978
Firefox doesn't support mp3. See this http://www.codingforums.com/showthread.php?t=231069

Can we apply video tags in a site that is HTML4 supported

I have a site that is having doctype html4 standard. We need to run videos of your site in ipad and we are willing to put in video tag into it to support video play into ipad. Do we need to change the doctype to html5 will it create problem in existing code. Like in css box model etc. We are supporting ie7 mozilla 3+ and chrome.
You don't have to have the HTML5 doctype to use the video tag.
It will depend on the browser how it chooses to handle it.
For example, here's a page with the video element using HTML4 doctype
view-source:http://www.longtailvideo.com/support/jw-player/jw-player-for-html5/11895/single-mp4-video
However, it renders fine in my Firefox. Try it on your browser of choice.
Shouldn't be a problem as previous content will still work as expected. I say update the doctype