Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

play flv in html

Tags:

html

flv

Can anyone give a concise instruction on how I can have a flv play from my html page please?

like image 216
neeep Avatar asked Feb 12 '10 00:02

neeep


1 Answers

With video.js its very easy. All you need to do is include js & css in head & then use html5 code as:

<head>
    <link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet">
    <script src="http://vjs.zencdn.net/c/video.js"></script>
</head>
<body>
    <video id="video1" class="video-js vjs-default-skin" width="640" height="480"
        data-setup='{"controls" : true, "autoplay" : true, "preload" : "auto"}'>
        <source src="video1.flv" type="video/x-flv">
    </video>
</body>

For further details: http://videojs.com/ Actually, I did not find information specified about playing flv files. But it works fine. :)

You can use other video formats using video.js all you need to change is type as...

<source src="..." type="video/mp4">

Moreover, there might some issue regarding your browser, does your browser support the .mp4 format, I could not play .mp4 in chrome, but it works fine in firefox. Try adding more sources with same video in different formats. Like...

<source src="video1.mp4" type="video/mp4">
<source src="video1.ogg" type="video/ogg">
<source src="video1.webm" type="video/webm">
like image 64
thegauraw Avatar answered Sep 18 '22 20:09

thegauraw