Skip to content

GuacLive/videojs-flvjs-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLV plugin for video.js using flv.js

Plays FLV with video.js by transmuxing FLV (either live or VoD) to MP4 and using MSE, using Bilibili's flv.js tech.

This plugin adds a source handler for flv files, as well as HTTP/Websockets for streaming live FLV streams. For more information, have a look below at the options

Installation

NPM

To install videojs-flvjs with npm run

npm install --save securogroup/videojs-flvjs

Getting Started

Get a copy of videojs-flvjs and include it in your page along with video.js (this shows the live websocket implementation):

<video id=player width=600 height=300 class="video-js vjs-default-skin" controls>
  <source src="ws://example.com/live/video.flv" type="video/flv">
</video>
<script src="video.js"></script>
<script src="videojs-flvjs.js"></script>
<script>
  var player = videojs('#player');
</script>

Options

flv.js is very configurable, you may pass in an options object to the source handler at player initialization. You can pass in options just like you would for other parts of video.js:

<video id=player width=600 height=300 class="video-js vjs-default-skin" controls>
  <source src="ws://example.com/live/video.flv" type="video/flv">
</video>
<script src="video.js"></script>
<script src="videojs-flvjs.js"></script>
<script>
    var player = videojs('video', {
        autoplay: true,
        html5: {
            flvjsConfig: {
                isLive: true,
                enableStashBuffer: false
            }
        }
    });
</script>

Thanks

Thanks to the videojs-contrib-hls.js plugin for the inspiration on how to write a custom tech. This repo is modled off theirs.

About

VideoJS Tech for playing FLV.js sources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%