How to play flash (.flv) video using video.js in chrome

I use video.jsto play Flash (.flv) video. But when I press the play button, it does not play the video?
I have used "techorder:"["flash","html"]. But that didn't matter.
Is there any plugin for flash video in videojs? How to play .flv video in video.js?

+4
source share
5 answers

video.js can play FLV in Flash technology.

If you are using video.js hosting and not using CDN, make sure the path to your swf is correct, for example

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

Verify that the correct video/x-flvmime type is used in the source tag :

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

, FLV, mime Content-Type.

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

+4

flv.js, FLV Player HTML5, JavaScript. .

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

flv.js video.js

+6

- https://github.com/videojs/video.js/wiki/Plugins , .

- http://jsfiddle.net/N8Zs5/18/

,

+2

.

You can choose one of them to support FLV video playback. Alternatively, you can use both of them and indicate their order on techOrder.

data-setup='{"techOrder":["html5", "flvjs", "flash"]}'
0
source

this project can 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>
0
source

Source: https://habr.com/ru/post/1607405/


All Articles