Reputation: 107
I am currently working on embedding video to a html document, and found that video.js is a useful JQuery player which can be used to play videos.
My html code is attached here.
<!DOCTYPE html>
<html>
<head>
<title>Video.js | HTML5 Video Player</title>
<!-- Chang URLs to wherever Video.js files will be hosted -->
<link href="/js/video-js.css" rel="stylesheet" type="text/css">
<!-- video.js must be in the <head> for older IEs to work. -->
<script src="/js/video.js"></script>
<script src="/js/jquery.js"></script>
<!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
<script>
videojs.options.flash.swf = "/js/video-js.swf";
</script>
<script>
$(function(){
var vidJS = videojs('example_video_1', {techOrder:['flash','html5']}).ready(function(){
$('example_video_1.vjs-big-play-button').show();
});
});
</script>
</head>
<body>
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="420"
data-setup="{}">
<source src="/js/source.flv" type='video/flv' />
<!-- <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />
<track kind="captions" src="demo.captions.vtt" srclang="en" label="English"></track><!-- Tracks need an ending tag thanks to IE9 -->
</video>
</body>
</html>
This page loads and plays video fine in my local system.(The page is located in my system) but if i try access the same page from other computers It doesn't play any video. in Firefox and IE9. But works fine for Chrome and IE10.
FF throws an error that videojs this.b.vjs_play is not a function when i press the play button.
Please someone suggest me is there any alternative player which i can use or this issue can be rectified.
Thanks.
Upvotes: 0
Views: 1652
Reputation: 107
Thanks, I found that if we have a flash player version less than 11, the video can't be playable. So i told my friends to update the flash player. This worked for us. But we were looking for a player which doesn't depends on flash.
Upvotes: 0
Reputation: 6030
HTML5 video element doesn't support FLV video format, at least in the specification (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#the-source-element), but some browsers could have implemented the support of the FLV so it is possible that the video will play in some browsers and won't play in others. You should use the formats supported by all the browsers: MP4, 3GP or OGV for example
Upvotes: 1