I have an html audio tag and it works just fine on desktop browsers. However, when I try to play it browsing on an iPhone (tried chrome, firefox, and safari), it just shows the pause button and nothing happens:
<audio class="mt-3" controls preload="auto" crossorigin="anonymous">
<source src="/media/example.ogg" type="audio/ogg">
</audio>
Any help would be greatly appreciated
.ogg files won't play natively on iOS as there is no built-in support. It will instead ask you to download the file (if you have storage to place it in).
Also see: Playing an ogg stream in iOS
Related
I have an HTML page that contains a MP4 video:
<html>
<body>
<video width="800" height="600" controls>
<source src="/static/xyz.mp4" type="video/mp4">
<p>Your browser does not support the video tag.</p>
</video>
</body>
</html>
When I load the page in Firefox, it doesn't show the play control buttons but shows error message "No video with supported format and MIME type found" (see the screenshot below).
So I use this site to test my browser's ability to play HTML5 mp4 video and it can successfully play the test video on that site. My Firefox version is v36 on CentOS Linux. I also tried using Chrome and it can't play it either. I also tried it on Firefox/Chrome on Windows but failed. I then use the Firefox debugger to look at the debug info and I see the following message:
Media resource http://localhost:5000/static/xyz.mp4 could not be decoded.
All candidate resources failed to load. Media load paused.
I then tried playing the xyz.mp4 video on my local machine using Linux's movie player and it plays fine and it also plays fine in Window's media player. But when I use the above HTML5 <video> tag, it doesn't play for all browsers in both Linux and Windows. I also followed Mozilla's online forum to change the browser settings and clear caches but none of them works. So what caused the problem of this simple HTML5 ?
This is very likely the problem with your video file. mp4 is not really a format, but a container that can hold video in different formats. Firefox supports only H.264 encoded video.
Simply speaking, there are several types of mp4 files and not all of them are supported by browser. To verify this, you can download one of the videos from the quicksmode website and replace your video with it.
Possible solution:
//autoplay muted onloadedmetadata="this.muted = true"
<video id="abc" autoplay muted onloadedmetadata="this.muted = true" >
<source src="https://github.com/mediaelement/mediaelement-files/blob/master/big_buck_bunny.mp4?raw=true" type="video/mp4">
Your browser does not support the video tag.
</video>
I recently uploaded some radio I worked on to my site, and it plays fine in both Chrome and FireFox, however when I test it in Safari, it simply says “loading.”
This is the code I’m using:
<source src=“x.ogg" type="audio/ogg">
<source src=“x.mp3" type="audio/mpeg">
Your current browser does support this audio.
Any ideas why this would be happening?
Actually, Safari do not support only Ogg file-format for this tag.
Please, check if you have x.mp3 file in same directory, as your .html file.
I have a website built with bootstrap and loading video in a dialog:
<video width="760" style="background-color: white;" preload controls autoplay>
<source src="....." type="video/mp4" />
</video>
Shows and works fine in IE, Chrome and Safari.
In Firefox auto play worked a few times, and now does not work at all.
No errors in console and video plays just fine manually using controls.
I have also tried script approach (without autoplay attribute):
oncanplay="$(this)[0].play()"
And works flawlessly on all browsers except Firefox.
Can anyone see what could be wrong?
I have tested this on all browser its working perfect with javascript event
<video onloadeddata="this.play();" poster="poster.png" playsinline loop muted controls>
<source src="video.mp4" type="video/mp4" />
<source src="video.mp4.webm" type="video/webm" />
<source src="video.mp4.ogg" type="video/ogg" />
Your browser does not support the video tag or the file format of this video.
</video>
The problem has an easy solution: changing the order of the videos, listing first the .mp4 source and next the .webm source made the auto-play videos run on Firefox, Explorer and Chrome, this of course is valid if you have multiple video sources.
A side note: Firefox supports H.264 on Windows 7 and later since version 21. Firefox supports H.264 on Linux since version 26 if the appropriate gstreamer plug-ins are installed. Partial support for Firefox refers to the lack of support in OSX & some Linux platforms, for Android Firefox it refers to the inability of hardware acceleration.
This worked for me for the firefox browser, but it have to be muted.
<video
width="100%"
height="100%"
onloadedmetadata="this.muted = true"
autoplay
>
<source src="assets/videos/Helpline_Video.mp4" type="video/mp4" />
</video>
First check your web page here for test
http://html5test.com/
Second inspect via code inspector and enter them in the browser to check if the are working fine or not. Or drag and drop video file over the browser to check if its working or not.
Thirdly try checking MIME Types
AddType video/mp4 for .mp4 .m4v
AddType video/ogg for .ogv
AddType video/webm for .webm
Fourthly check you html5 converter it has often problem with format conversion I had same problem year back when I was working html5 video. Changing it fixed the issue for me.
Last but not the least; Add a flash fall-back!
<object type="application/x-shockwave-flash"
data="http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf"
height="227" width="220">
Firefox Video Issue: Troubleshooting
Make sure that the server sends the video files with a correct and supported MIME type to make it work in Firefox.
link
Use source URL relative to ROOT, not Web page
Eg: src="/complete/folder/path/video.ogv"
Version of mozilla.
Mozilla Firefox (3.5 and later) supports Theora video and Vorbis audio in an Ogg container.
Firefox 4 supports WebM.
link
From Firefox 66 and aboew, you must click the unblock button on the right of browser bar to unblock Autoplay Video and Audio
I have used the following html audio tags to plays different files in different sound formats
<audio controls="player_1">
<source src="D:\HND grrrrr\Year_2\RoyWebsite\Sounds\WAV\home_page_readout.wav" type="audio/wav"/>
<source src="D:\HND grrrrr\Year_2\RoyWebsite\Sounds\MP3\home_page_readout.mp3" type="audio/mp3"/>
<source src="D:\HND grrrrr\Year_2\RoyWebsite\Sounds\ogg\home_page_readout.ogg" type="audio/ogg"/>
</audio>
Now the right sound format plays in IE and Chrome, however when i open the page up in Opera or Safari, the sound player appaears but the play button does not work when it is pressed, as if the file cannot be found or something ?
Oh and I don't know what the type/ part is so separated on the first line
Try using relative path or even move the files to some web server. That should be it.
And obviously - update your browser.
BTW: There are some html5 features (like desktop notifications) which won't work locally at all.
I try to add the video tag on a website, but I encounter a problem.
The video is well played in Chrome but not in Firefox even the URL is correct.
<video src="http://127.0.0.1/st_martin/index.php/fre/content/download/89/643/file/test-video.mp4" width="640" height="266" poster="/st_martin/var/ezwebin_site/storage/images/les-partenaires/l-auberge-gourmande/video-1/764-5-fre-FR/Video-1_large.png" controls>
Your browser does not support the <code>video</code> element.
</video>
And enervous thing : when I copy/paste file URL in firefox it plays the video without any problem.
Using embed video player cause a neverending loading animation.
Firefox does not support .mp4 playback. Try conveting the video to .ogg format which is fast becoming a standard format for html 5 applications.