I have a user requirement to embed mp4 and flv in the website. I have not found any success with this.
I realised that
<video> </video>
does not do the magic.
Is there any other way?
HTML5 does not support .FLV files directly. You will need to convert the .FLV files or use a Flash Player. See the spec for more info
You can, however, embed a .swf file, I believe. See this SO question for more information there.
As for MP4 format, Firefox versions before v21 and Opera do not support it. Opera and older versions of Firefox both support WebM and Ogg Vorbis format for video, however.
To the best of my knowledge, Chrome doesn't support WMV. Opera, Firefox and Chrome support Ogg Theora+Vorbis, while Chrome and Safari support MPEG-4 H.264+AAC.
<video controls>
<source type="video/ogg; codecs=theora,vorbis" src="video.ogv">
<source src="video.wmv">
Your browser doesn't support video, you may download the
video instead: Ogg
</video>
The only browser that might be able to play WMV is Opera on Linux (if you happen to have the right GStreamer plugins installed). That's not very useful, so you should probably just not use WMV with at all.
You might find this useful reading: Everything you need to know about HTML5 video and audio.
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
<source src="movie.webm" type="video/webm">
<object data="movie.mp4" width="320" height="240">
<embed src="movie.swf" width="320" height="240">
</object>
</video>
read more about this : http://www.w3schools.com/html/html_videos.asp
Why You Should Use the MP4 File Format Instead of FLV : http://www.techsmith.com/tutorial-camtasia-why-you-should-use-mp4.html
Related
I have looked everywhere online to try and solve this issue.
I have got the following code on my website which works fine on all browsers apart from Microsoft Edge, it simply says that the content is not supported, so it is recognising the video tag.
I'm displaying an MP4 video, codec: H.264, AAC
<video width="100%" controls id="slider-video">
<!-- <source src="img-src/{v2_FOLDER}/theme/GMS_Final.webm" type="video/webm"> -->
<source src="img-src/{v2_FOLDER}/theme/GMS_Final.mp4" type='video/mp4; codecs="avc1.64001E, mp4a.40.2"'>
<p>Your browser does not support the video tag.</p>
</video>
As you can see, I have even tried using an webm but this also doesn't work... any ideas?
Updated Code:
<video width="100%" controls id="slider-video">
<source src="http://devsite6.clickserverdev.co.uk/img-src/_themev2-germanmotorspecialist-1131/theme/GMS_Final.webm" type="video/webm">
<source src="http://devsite6.clickserverdev.co.uk/img-src/_themev2-germanmotorspecialist-1131/theme/GMS_Final.mp4" type="video/mp4">
<source src="http://devsite6.clickserverdev.co.uk/img-src/_themev2-germanmotorspecialist-1131/theme/GMS_Final.m4v" type="video/m4v">
<source src="http://devsite6.clickserverdev.co.uk/img-src/_themev2-germanmotorspecialist-1131/theme/GMS_Final.ogg" type="video/ogg">
</video>
Make sure to use the correct MP4 compression with H264 codec (maximum 720p of resolution) with AC3 audio on it.
Edge is like browsers on iPad/iPhone and needs the same H264 compression style.
Drag and drop your mp4 video file to IE-Edge to play it directly from local file system. So you will be sure if your video correctly converted.
<video controls>
<source src="video.mp4" type="video/mp4">
<object>
...
</object>
</video>
This HTML5 video tag with a mp4 video and a Flash fallback works in every single browser all over, except from Opera on PC.
But if I move the "object" out of "video", it will work - so that means Flash is properly installed and working.
Is there a solution to this, or do I have to make some sort of a workaround by checking for browser and then displaying a pure Flash player for Opera?
The Flash fallback only works on old browsers that can't process the <video> element natively - but that doesn't include Opera. Opera tries to play your HTML5 media... and fails.
Your issue is that Opera can't play the mp4 file. Try adding a fallback webm version to support it:
<video controls>
<source src="video.mp4" type="video/mp4">
<source src="video.webm" type="video/webm">
<object>
...
</object>
</video>
I'm creating a webpage that is using HTML5 for videos. I tried one video, and it loaded and played successfully. But then, the other video does not even load. How can I fix this? The code is the same for the working video and the not working video
<video src="SnakeVids/sukyandaru.mp4" width="350" height="300" controls="controls" type="video/mp4"></video>
Btw, the difference is that the first video is a .mp4, and the other one I converted from .flv to .mp4.
After reading the comments, it looks like your video was converted into a format that is not compatible with Google Chrome. MP4 supports some codecs but only a small subset is widely supported, and Chrome supports these video formats for the <video> tag.
You should encode your video using a supported codec.
Additionally, you might want to provide different sources for compatibility with other browsers and platforms.ogg is a safe choice. A simplified example extracted from w3schools:
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
You can also use third-party libraries, like videoJS, that will help you with video formats support. Some of them even have a flash fallback.
I have a video player in HTML5, pretty simple.
<video width="470" height="265" preload="none" controls="controls" id="video_player" poster="assets/posters/finished_jk.jpg">
<source type="video/webm" src="assets/videos/finished_jk.webm"></source>
<source type="video/ogg" src="assets/videos/finished_jk.ogv"></source>
<source type="video/mp4" src="assets/videos/finished_jk.mp4"></source>
Your browser doesn't support videos
</video>
I have an issue with Firefox. When I click the play button, it's going directly to the end of the video.
It works with Chrome, Safari and Opera.
Thanks
The problem came from the encoder software I used.
I used "Miro Video Converter" to convert my mp4 video in webm format. I tried with another one and it works fine.
i have a video file (avi with avc+mp3). Is it possible to play this via the HTML5 video-tag?
i have tested it in Internet Explorer 9 but it will not work! Is it because the audio codec mp3 is not supported or is it the "video Codec-Profile "HighL3.0"?
Edited to fix misunderstanding
I suggest you do some reading about the ongoing codec wars, or look at this table. Basically, some browsers accept only videos with a MP4 container, H.264-encoded video, and AAC-encoded audio (low-complexity profile); some browsers accept only videos with a WebM container, VP8-encoded video, and ogg-vorbis-encoded audio.
MP4/H.264 seems to be winning the war, but at the moment you'll need both for complete browser support.
Modern browsers which support <video> use WebM, MP4/H.264 and OGG video format. So you can't use AVI for HTML5 video. There is no unique format which is supported by all browsers. The only solution is to convert file to supported formats and use <video> like this:
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4"> <!-- IE, Chrome, Safari, Android -->
<source src="movie.ogg" type="video/ogg"> <!-- Firefox, Chrome, Opera -->
<source src="movie.webm" type="video/webm"> <!-- Firefox, Chrome, Opera, Android -->
Your browser does not support the video tag.
</video>