I have a dynamic video path coming from database. Video can be uploaded in any format. When I load the video in Firefox, I see the following errors
Specified “type” attribute of “video/mp4” is not supported. Load of media resource path_to_video.mp4 failed.
I am loading the video in my html like
<p> <video class="responsive-video" id="trailer"> <source src="<?php echo $biovideo?>" type="video/mp4"> </video> </p>
Is there any way to play the mp4 videos in Firefox as I am not sure what extension the video will have
Update - Feb 2019
Firefox no longer uses GStreamer and instead interfaces directly with ffmpeg. Hence the flag mentioned below will no longer appear in current version of Firefox.
There is now a flag media.ffmpeg.enabled which again can be set to true:
In practice this is not necessary on many platforms - the latest official Firefox online notes say:
Patented media MP3, AAC, and H.264/MPEG-4 AVC are patented audio/video compression formats. They can be viewed in Firefox using built-in OS libraries (so neither Mozilla nor you need to pay a fee) if embedded in the MP4 container format (.mp4, .m4a, .m4p, .m4b, .m4r, .m4v file types).
To verify, a test as at February 2019:
Original answer - for older versions of Firefox
As noted in the comments Ubuntu/firefox does not support mp4 natively - this is due to licensing issues. The Mozilla documentation is a little confusing (IMHO) so the table at the bottom is probably the best place to look.
However you can add support fairly easily by installing Ubuntu extras:
sudo apt-get install ubuntu-restricted-extras
and then enabling gstreamer:
This should allow you play the video.
For ubuntu 20.04, run:
apt install libavcodec58
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With