Video is not getting played using video.js - html

Below is the html code which i am using to play videos in my video folder using video.js link
<!DOCTYPEs>
<html>
<head>
<link href="http://vjs.zencdn.net/4.2/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/4.2/video.js"></script>
</head>
<body>
<video id="sample" class="video-js vjs-default-skin" controls preload="none" width="640" height="264"
data-setup="{}">
<source src="/video/video1.mp4" type='video/mp4' target="_blank"/>
<track kind="captions" src="demo.captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 -->
</video>
</body>
</html>

You didn't write in what browser are you trying to make the code work. Is it possible that your browser doesn't support the video format? Chrome supports .mp4, but for example Firefox doesn't, it supports .webm.
You can read more about this in the WebPlatform Docs

Related

Why don't my vtt subtittles show up on my html5 video?

I'm trying to use subtitles with my HTML5 video tag, but I can't get this to work.
I think the issue is that the video source isn't a local file.
Does anyone know how I can get around this?
<html>
<head>
<style id="stndz-style"></style>
<meta name="viewport" content="width=device-width">
</head>
<body>
<video id="video" controls autoplay="" name="media">
<source src="http://localhost:8888/" type="video/mp4">
<track label="Dutch" kind="subtitles" srclang="nl" src="/home/ubuntu/Desktop/scripts/example.vtt" default>
</video>
</body>
</html>
and this is my example.vtt:
WEBVTT
00:01.000 --> 00:04.000
Never drink liquid nitrogen.
00:05.000 --> 00:09.000
- It will perforate your stomach.
- You could die.
Turns out that cromium not letting me use local files was the issue. So my workaround is to run chromium like this:
chromium --allow-file-access-from-files

video.js fallback is not working

This is my code
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script src="javascripts/video.js-stable/dist/video-js/video.js"></script>
<link rel="stylesheet" type="text/css" href="javascripts/video.js-stable/dist/video-js/video-js.css" />
<script>
videojs.options.flash.swf ="http://localhost/site/public/javascripts/video.js-stable/dist/video-js/video-js.swf";
</script>
<title>video</title>
</head>
<body>
<video id="example_video_1" class="video-js vjs-default-skin"
controls="" preload="auto" width="640" height="264"
poster=""
data-setup='{"example_option":true}'>
<source src="http://localhost/site/public/videos/ogg.mp4" type='video/mp4'/>
</video>
</body>
</html>
when i play video in firefox 3 then firefox crashed and when i use firefox 11 then it play fine...i read somewhere that firefox is not suported mp4 videos in html5.
If mp4 is not supported by firefox in html5,that means my code is using flash,because video is playing fine in firefox 11,or how can i check my code is using flash as fallback.
one more thing when i try to play 3gp video then it show error in all modern browser.
error:Sorry no compatible source and playback technology is found.
what is real problem ?? please help. thanks in advcance!!
For more information about Firefox MP4 support, visit this page.
Specify multiple alternative media resources for compatibility using source:
<video ...>
<source src="video.mp4" type="video/mp4">
<source src="video.ogv" type="video/ogg">
...
</video>
Place object with flash inside video to provide fallback:
<video ...>
<source src="video.mp4" type="video/mp4">
...
<object type="application/x-shockwave-flash" data="flash_player.swf" ...>
<param name="movie" value="flash_player.swf">
<param name="flashvars" value="flash-variables">
...
</object>
</video>
.3gp support:
<source src='video.3gp' type='video/3gpp; codecs="mp4v.20.8, samr"'>

HTML video not working

I am trying to get a video to play locally but it isn't working. the file is 'wildlife.mp4,' however, it doesn't play it is just a blank video box? Any help will be much appreciated, thanks.
<!DOCTYPE html>
<html>
<head>
<title>video</title>
</head>
<body>
<video width="320" height="240" controls>
<source src="wildlife.mp4" type="video/mp4">
<source src="wildlife.ogg" type="video/ogg">
Your browser does not support the video tag.
</body>
</html>
Video tag is not closed.
Add autoplay if you want the video to play automatically.
<!DOCTYPE html>
<html>
<head>
<title>video</title>
</head>
<body>
<video width="320" autoplay="autoplay" height="240" controls>
<source src="wildlife.mp4" type="video/mp4">
<source src="wildlife.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>
If you are running the script on Windows the browser can check the file type associated with the video ( wildlife.mp4 ). On my system ( W7) I clicked the -Properties- on the video file and CHANGed the -Type of file- from VLC (which is the default on my system) to Windows Media player and all was sorted.
Hope this helps.

html5 video only works in safari

Im new to HTML 5 and learning from w3schools
I tries to get the html video code working for a file I have. Trouble is that the html only works in safari but not the other browsers I have.
Any ideas please?
thanks
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls="controls">
<source src="candonjoel.mp4" type="video/mp4" />
<source src="candonjoel.webm" type="video/webm" />
<source src="candonjoel.ogg" type="video/ogg" />
Your browser does not support the video tag.
</video>
</body>
</html>
Does candonjoel.webm exist? Can you show the URL of your code please?
https://github.com/kaihendry/recordmydesktop2.0/ is project to make screencasts easier from Linux to all browsers.

In firefox I am not able to open video tag

<!DOCTYPE HTML>
<html>
<body>
<video width="320" height="240" controls="controls">
<source src="tutorial.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
</body>
</html>
this tutorial.mps is stored in the same folder but I am not able to open that video I got that sentence Your browser does not support the video tag.
See this link about media format browser compatibility. The firefox doesn't support mp4 yet. Convert the file e.g. to ogg and add an additional source-tag.