Skip to content

hmica/clappr-rtmp-plugin

 
 

Repository files navigation

clappr-rtmp-plugin

RTMP support for Clappr player. Supports both RTMP direct and SMIL (dynamic streaming).

How to use

Import rtmp.min.js

<script type="text/javascript" src="http://cdn.jsdelivr.net/clappr.rtmp/latest/rtmp.min.js">
</script>

and create Clappr Player adding the external plugin:

var player = new Clappr.Player({
    source: "rtmp://source_here",
    parentId: "#player-wrapper",
    plugins: {'playback': [RTMP]},
    rtmpConfig: {
        swfPath: 'dist/assets/RTMP.swf',
        scaling:'stretch',
        playbackType: 'live',
        bufferTime: 1,
        startLevel: 0,
    },
});

Configuration

The plugin accepts several optional configuration options, such as:

  • swfPath (default //cdn.jsdelivr.net/clappr.rtmp/latest/assets/RTMP.swf) - Path to the SWF responsible for the playback.
  • scaling (default letterbox) - Path to the SWF responsible for the playback.
  • playbackType (default live if the source contains live on its URL, vod otherwise).
  • bufferTime (default 0.1) - How long to buffer before start playing the media.
  • startLevel (default -1) - Initial quality level index.

Building

Requirements

  1. AirSDK
  2. Webpack

Compile SWF

cd src
sh build_player.sh

Download JS dependencies

npm install

Build the final dist

webpack

About

RTMP support for Clappr player

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • ActionScript 63.8%
  • JavaScript 28.0%
  • HTML 6.4%
  • Shell 1.3%
  • CSS 0.5%