7

I am using video.js to play flash(.flv) video. But when I press play button it does not play video?
I have used the "techorder:"["flash","html"]. But it made no difference.
Is there any plugin to for flash video in videojs? How can I play .flv video in video.js?

BhushanK
  • 1,205
  • 6
  • 23
  • 39

6 Answers6

8

You should use flv.js, an HTML5 FLV Player written in pure JavaScript. No Flash is required.

https://github.com/Bilibili/flv.js

You can make a source handler to integrate flv.js with video.js

xqq
  • 81
  • 1
  • 2
5

video.js can play FLV in the Flash tech.

If you're self-hosting video.js rather than using the CDN, make sure the path to your swf is correct, e.g.

<script>
  videojs.options.flash.swf = "http://example.com/path/to/video-js.swf"
</script>

Make sure to use the correct video/x-flv mime type in the source tag:

<source src="http://example.com/video.flv" type='video/x-flv'>

The server hosting the FLV must also return the correct mime type in the 'Content-Type` header.

Example: http://output.jsbin.com/juvuca

misterben
  • 7,455
  • 2
  • 26
  • 47
  • its not working in my local file. jsbin output example is working fine.Please guide me how to solve this problem for local file – Muhammad Zafar Naeem Sep 15 '15 at 15:43
  • Define local file. Modified copy of video.js, flv served from file://, something else? Code for or a link to minimal test case would help. – misterben Sep 15 '15 at 17:09
  • its working fine on localhost but not working on c9.io please help how to solve this problem. I am using node js. – Muhammad Zafar Naeem Sep 16 '15 at 23:34
  • I have tried this but not working. When compared my page with the given example, I have noticed that video tag got replaced with object tag (in example page), but its not happening in my case. Can any one help me to understood what I am missing!! – kalki Apr 13 '16 at 05:41
  • It's very weird that it can play flv when opening a remote html file. After I saved the remote html and opened it locally, there was only a giant play button, nothing else happened. [File on jsbin](http://output.jsbin.com/hihodosijo). – Zen May 14 '16 at 07:01
  • FLV video not playing locally, you can check out this: https://github.com/videojs/video.js/issues/1461 – gnemoug Jun 13 '16 at 00:58
  • The [example in this answer](http://output.jsbin.com/juvuca) shows "no compatible source was found for this video". – Martin Argerami Jul 15 '22 at 20:37
3

You can find the plugin here -https://github.com/videojs/video.js/wiki/Plugins Not sure if this will work.

If not try this as well -http://jsfiddle.net/N8Zs5/18/

Regards, Shashi

Shashi Kiran
  • 362
  • 2
  • 9
  • 27
2

Two ways.

You can choose one of them to support playing flv video. Also, you can use both of them and specify their order by techOrder option.

data-setup='{"techOrder":["html5", "flvjs", "flash"]}'
user5698801
  • 576
  • 4
  • 10
1

this project may help you, https://github.com/mister-ben/videojs-flvjs

<!-- Video.js -->
<link href="//path/to/video-js.css" rel="stylesheet">
<script src="//path/to/video.min.js"></script>
<!-- flv.js -->
<script src="//path/to/flv.min.js"></script>
<!-- videojs-flvjs -->
<script src="//path/to/videojs-flvjs.min.js"></script>
<video id="videojs-flvjs-player" class="video-js vjs-default-skin" controls>
  <source src="movie.flv" type='video/x-flv'>
</video>
<script>
  // For v5 the tech must be added to the tech order.
  // For v6 this is not needed.
  videojs('videojs-flvjs-player', {
    techOrder: ['html5', 'flvjs'],
    flvjs: {
      mediaDataSource: {
        isLive: true,
        cors: true,
        withCredentials: false,
      },
      // config: {},
    },
  });
</script>
Hoonick
  • 11
  • 1
1

I made refactor of videojs-flvjs for compitable with es6 module. https://www.npmjs.com/package/videojs-flvjs-es6

xlaoyu.Lee
  • 333
  • 2
  • 9
  • As of March 2022, this is the only working solution to my Vue-based project. It's easy to integrate with video.js. Nice one! @xlaoyu.Lee – Kamyar Mar 29 '22 at 07:27