<commit_before>clappr-rtmp-plugin
==================

RTMP support for [Clappr player](http://github.com/globocom/clappr)

## How to use

Import rtmp.min.js

```javascript
<script type="text/javascript" src="http://cdn.jsdelivr.net/clappr.rtmp/latest/rtmp.min.js">
</script>
```
and create Clappr Player adding the external plugin:

```javascript
var player = new Clappr.Player({
      source: "rtmp://source_here", 
      parentId: "#player-wrapper", 
      plugins: {'playback': [RTMP]}
    );
```

Streams that has `live` on their URL will be handled as live streams. If not so, the plugin will play the source as VoD.

<commit_msg>New instructions on Readme<commit_after>clappr-rtmp-plugin
==================

RTMP support for [Clappr player](http://github.com/globocom/clappr). Supports both RTMP direct and SMIL (dynamic streaming).

## How to use

Import rtmp.min.js

```javascript
<script type="text/javascript" src="http://cdn.jsdelivr.net/clappr.rtmp/latest/rtmp.min.js">
</script>
```
and create Clappr Player adding the external plugin:

```javascript
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 **0**) - Initial quality level index.

## Building

#### Requirements

1. [AirSDK](http://www.adobe.com/devnet/air/air-sdk-download.html)
2. [Webpack](https://www.npmjs.com/package/webpack)

#### Compile SWF

```sh
cd src
sh build_player.sh
```

#### Download JS dependencies

```sh
npm install
```

#### Build the final dist

```sh
webpack
```

{'fraction_non_alphanumeric': 0.16793211255024565, 'fraction_numerical': 0.0031263957123715946, 'mean_word_length': 3.890829694323144, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '996765', 'n_tokens_mistral': 758, 'n_tokens_neox': 726, 'n_words': 206}