I tried to add a .mp4 video on my web page. And it doesn't work, I got an error in firebug. Bellow is the code:
<video width="320" height="240" controls>
<source type="video/mp4" src="08.mp4" >
</video>
Error:
"NetworkError: 404 Not Found - http://localhost/08.mp4"
HTTP load failed with status 404. Load of media resource http://localhost/08.mp4 failed.
All candidate resources failed to load. Media load paused.
I tried with a .m4v video, and it works fine:
<video width="320" height="240" controls>
<source type="video/mp4" src="Big_Buck_Bunny_Trailer.m4v" >
</video>
If I tried to access http://localhost/08.mp4 I got the following:
A 404 error occurred
Page not found.
The requested URL could not be matched by routing.
No Exception available
Both videos are in the same folder.
Codec information:
Can you tell me please where is the problem?
I solved the problem.
Because I use zend2 framework the folder with video should be in the public folder.
First I put the video in other folder, now I moved it in public and works fine.
Related
I noticed that IDM (internet download manager) does not come up in this page when the video starts playing: https://www.w3schools.com/html/html5_video.asp
the code behind this page is a simple html5 video tag:
<video id="video1" style="width:600px;max-width:100%;" controls>
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
When I use the exact same code with the same video in localhost, IDM starts. I have no special setting or exclusions in IDM. So what is the secret behind this page that IDM is not starting?
Some videos are protected by Copyright and use special protected protocol. It is restricted to save any data recived by this protocol. IDM does not support it for legal reasons.(Reference)
To check that this is the reason why video is not shown, you need to open "Options->General" IDM dialog and press "Edit" near "Customize IDM Download panels in browsers".
I have to make a video gallery in HTML5. I also use symfony 3.4 in my project. I use the HTML5 tag to display video on my page. There is a sample:
<video controls preload="auto" poster="{{ asset('img/poster.jpg') }}" width="100%">
<source src="{{ asset('video/video1.mp4') }}" type="video/mp4">
Your Browser is not supported
</video>
The problem is that, I want my video loading while playing and not playing after loading completed
I'm a new developer. I've created a simple HTML5 page and this is the first time I'm using HTML5 to display a video.
My problem is: I could view the video on my local machine however I can not see it online.
Can someone help to make this video work online?
here is the code :
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.webm" type="video/webm" />
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>
You can try something like this:
<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 will, of course, have to put the correct src for the file you want to play. Finding the correct path would depend on the server/hosting you are using but if you know how to upload the video online, you should be able to figure out what the correct path is as well. Posting some code in your question would help give you a better answer.
I am trying to play a vimeo m3u8 hls video in videojs player. I am getting cross domain error. Can anybody help me.
My code.
<video autoplay id="content_video" class="video-js vjs-default-skin"
poster = "//test.waytogrow.pl/wideo/videojs/posters/android.png" controls preload="auto" width="640"
height="360">
<source src="https://player.vimeo.com/external/155002167.m3u8?p=standard&s=1d09b138bbb4218361013c45d706889df4a80fee"
type="application/x-mpegURL" ></source>
</video>
Error
XMLHttpRequest cannot load https://player.vimeo.com/external/155002167.m3u8?p=standard&s=1d09b138bbb4218361013c45d706889df4a80fee. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example.com' is therefore not allowed access.
You can't fix this. Only Vimeo can, by adding CORS headers to the responses. Otherwise you need to host the video elsewhere.
I am trying to get video to play in an HTML5 video tag using the following code:
<video id="video" width="768" height="432" controls>
<source src="http://example.com/videos/example.mp4" type="video/mp4" />
</video>
Initially this was not working and I tracked it down to being an issue with Basic Authentication being enabled on the domain. However, if I try reenabling it in the .htaccess file as follows:
AuthUserFile /folder/containing/.htpasswd
AuthType Basic
AuthName "Members Area"
Require valid-user
The video player just stalls on the "Loading..." screen. Additionally if I try to access the file directly the playback in the browser reverts to using the quicktime controls and not the HTML5 controls you get when the authentication is turned off
At present the only solution I have is to remove / avoid requiring authentication in the folder containing the movie files for the site. However, I preferably need to keep the authentication enabled across the whole domain.
Therefore I am wondering if there is a way to serve video content which is located behind basic authentication.
Note: I am currently working to get this working in Safari and hence the focus towards the mp4 format.
You can use like this:
<video id="video" width="768" height="432" controls>
<source src="http://username:password#domainname.com/video/video.mp4" type="video/mp4" />
</video>
This can help I think.