play flv in html
Asked Answered
K

6

15

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

Kee answered 12/2, 2010 at 0:22 Comment(1)
Maybe this could help: #99906Extenuatory
C
31

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">
Christianachristiane answered 25/6, 2012 at 5:58 Comment(2)
This just gives me black rectangle.Hasty
because this is explaining how to play everything else but not flvPosh
X
6

Wrap a flash player around it, such as Flowplayer. There currently is no other way; browsers can't just render an FLV by itself.

See the installation guide for Flowplayer, taking you step-by-step on how to place the video directly into your HTML.

Xenogenesis answered 12/2, 2010 at 0:25 Comment(3)
ok, flowplayer thanks..what does that entail? will user be able to view the video with flash player then?Kee
Yep. Flowplayer is a Flash file that plays the video and puts the controls (play, pause, volume, etc) around it. It requires the Flash plugin, but if you have an FLV file, you have no other choice.Xenogenesis
Glad it worked :) Be sure to click on the check mark next to an answer if it solved the problem, so that the poster gets credit :)Xenogenesis
O
1

I'm fairly certain that shadowbox can also play FLV files: http://www.shadowbox-js.com/

It's clean, minimal and fairly simple to setup.

Oxidimetry answered 19/10, 2010 at 23:46 Comment(2)
Shadowbox looks great. It does the lightbox effect I wanted and the commercial license is only $20 as opposed to $90 for JW Player or $60 for the FLVPlayer.com commercial license.Medford
CORRECTION: the shadowbox actually uses the JW Player and you still have to buy the JW Player if you're going to use it for commercial purposes. I really don't understand why there are any Free/Cheap flash video players out there. I don't need anything fancy, just simple and clean.Medford
H
1

You can try https://github.com/Bilibili/flv.js

With flv.js, You'll get:

  • Pure HTML5 + JavaScript Video Player for flv videos
  • Pure HTML5 + JavaScript LiveStream Player for http-flv streams
  • Flawless experience
  • Smaller size than H.264 Videos

Flv.js utilizes MSE (Media Source Extensions) therefore it'll only be available on Chrome 43+, Firefox but not Apple / iOS Safari.

Flv.js instantaneously transmuxes flv streams to H.264 streams and then push the H.264 stream to Media Source Extensions. It'll display as a video tag in HTML Element with a blob URL.

Haymaker answered 31/12, 2016 at 12:28 Comment(0)
S
0

Another really popular Flash player is the JW Player, at http://www.longtailvideo.com/ . They have a nice setup wizard that generates the code you need.

Shuddering answered 12/2, 2010 at 0:50 Comment(0)
S
-2

Insert an SWF object into your HTML and assign the FLV in the attributes as the video that will play.

Sharilyn answered 12/2, 2010 at 0:25 Comment(2)
Insert an SWF object into your HTML and assign the FLV in the attributes as the video that will play You're going to have to be a bit more concise please?Kee
See my answer - it means that you must embed a Flash-based video player (an SWF file) into your HTML code, and tell it where the FLV video lives on your server. You can't just directly embed an FLV file.Xenogenesis

© 2022 - 2024 — McMap. All rights reserved.