playing mp4 files in html5 - html

I am trying to play a mp4 file from my server on google chrome. but nothing hapens when press play, it lights up for a split second (which shows the does exist) but then fails to stream. If I enable divx webplayer extension on chrome it plays it through divx player, however I need it to be possible to play it without that extention. here is the code I am using:
<video width="560" height="340" controls>
<source src="hood.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2" '>
</video>

Semi-answer: try and use JWPlayer it plays pretty much anything and it automatically downgrades if needed. (Using HTML5 or Flash)

Related

HTML Videos Loop & Autoplay

I’ve tried setting them to be true and changing the order in some hope it will help. So far it’s not working I’m sure the videos silent but I muted it anyway. I want it to autoplay and loop. It does neither.
<video loop autoplay muted class="VideoMain">
<source src="A.mp4" type="video/mp4">
</video>```
I don't have A.mp4, but after trying your code with another MP4 video, it seems to work fine.
<video loop autoplay muted class="VideoMain">
<source src="https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4" type="video/mp4">
</video>
Since your code is fine, the problem must be with the video file.
Ensure that your video file is not corrupt and can be accessed.
Your MP4 is not from a live stream (ie: is not a fragmented-MP4, that needs MSE to play).
Ensure the MP4 is containing H.264 video (and AAC audio, if got sound).
MP4 can sometimes have H.265 video codec. Only supported browser is Safari (Apple).
Use MediaInfo to check video details and then confirm if your browser supports that setup.
Use a Hex editor for your OS to check the video file's bytes. A working MP4 should show moov in second or third line. If not, then video is not playing because metadata is not available (needs moving from back of file to the front).
Also check that you have saved and are accessing your site through the development version. All are common mistakes we make in the heat of development.

Play HTML5 video located on network server

I want to play a video with html5 video tag from a network server.
I'm also make the test with an image, but I got, with Google Chrome, the error "Not allowed to load local resource".
I've already searched and this happens by security reasons of the new web browses.
For the video I'm using the basic html. If I play the video from my computer, like, it work well (obviously)
<video width="320" height="240" controls>
<source src="videos/movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
But when I change the source to: 'file:///fileof1/FILESRV/videos/movie.mp4', nothing happens.
Anyone with a solution?

HTML5 Simple Video Player. What did I miss?

First I made a screen recording as a video I would like to display.
Than I uploaded the video to VLC to convert the video.
I made one MP4 and a fallback for OGG.
I then moved the videos to my dropbox account so I can host them there.I right clicked and got the link to each video from dropbox. I am trying to use the links as the src in the video tags.
<video width="400" controls>
<source src="https://www.dropbox.com/s/m7emkfs994sgm5g/Untitled.m4v?dl=0" type="video/mp4">
<source src="https://www.dropbox.com/s/9owwdbm8p0nz1f0/oggguntitled.ogg?dl=0" type="video/ogg">
</video>
Even though I told VLC to convert it to MPV, the file extension is m4v.. Is that the same thing?
The video just shows blank. Not getting any errors either.Not sure what I missed.
The following Fixed it for me.
I made two changes:
change dl=0 at the end of your dropbox link to dl=1. I believe this makes it a download link instead of a page to view a download link.
Due to a bug in chrome on OSX certain mp4 files will fail to play correctly (some kind of graphics acceleration issue), but it won't fall back to the ogv. For this reason, i have placed the ogv as first since it will work on OSX-chrome, and platforms that don't support it should fall back to the mp4.
<video width="400" controls>
<source src="https://www.dropbox.com/s/9owwdbm8p0nz1f0/oggguntitled.ogg?dl=1" type="video/ogg">
<source src="https://www.dropbox.com/s/m7emkfs994sgm5g/Untitled.m4v?dl=1" type="video/mp4">
</video>

Can you embed VLC on a website so that people who doesn't have VLC installed can view it?

I am trying to make a video streaming site and I want to use VLC to play my video. However, I want other people who doesn't have VLC to be able to view my videos through a VLC plugin. Is it possible? I want to use VLC because it can play anything.
The viewer has to have VLC and the Browser Plugin Installed on there pc, depending on the file format of the video you could use the HTML5 Video tag.
<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.
Update your browser.
</video>
This will only work if the viewer has a html5 ready browser meaning old versions of IE wont be able to see the video but the code will tell them that they have to update there browser
You might want to checkout the current beta of http://www.projekktor.com - it's a generic HTML 5 player, which uses whatever backend is available on the user's PC. Since recently, it also supports VLC: https://twitter.com/projekktor/status/354187957571297281

Why is Google Chrome not loading my video?

I have created 3 versions of a video file using Miro Video Converter to facilitate different browsers and I am using the following code to play them...
<video class="rw-video video-js" data-settings="rw-green rw-flat-color rw-rounded" title="My movie title" preload="auto" controls width="800" height="400" id="exampleVid1" poster="images/video.png" >
<source src="images/movie1.mp4" type="video/mp4" />
<source src="images/movie1.ogv" type="video/ogg" />
<source src="images/movie1.webm" type="video/webm" />
<p>Your browser does not support the video tag.</p>
</video>
The video plays just fine in firefox and safari but not in chrome - it appears to play in chrome but never starts - the hourglass just goes round and round and it never plays. I have checked filenames and that the video is uploaded. Any ideas? I wondered if Chrome maybe interprets "preload="auto"" to mean preload the entire video but fiddling with that didnt make any difference I could see. The movies are around 50mb in total and load instantly in other browsers.
this is actually a Google Chrome bug which prevents it to load more than 6 MP4 videos. Try putting preload="none" on all the videos and then start clicking on them. You will probably be able to open 6 of them but on 7th video Google Chrome will hang. That is how it is with me, but maybee this will happen sooner on your system.
But you will trigger the bug if you have MP$ video among your videos, so it is best to completely avoid the MP4 format. I solved it completely by using webm video format.