<commit_before>Video.js Record
===============

A Video.js plugin for recording audio/video files.

![Screenshot](examples/img/screenshot.png?raw=true "Screenshot")

Installation
------------

Use [bower](http://bower.io) (`bower install videojs-record`) or
[npm](https://www.npmjs.org) (`npm install videojs-record`) to install
the plugin or download and include the dependencies manually.

The plugin has the following mandatory dependencies:

- [Video.js](http://www.videojs.com) - HTML5 media player that provides the user interface.
- [RecordRTC.js](http://recordrtc.org) - Adds support for audio/video recording.

When recording audio-only, the following dependencies are also required:

- [wavesurfer.js](https://github.com/katspaugh/wavesurfer.js) - Provides a navigable waveform for audio files. Comes with a [microphone plugin](http://www.wavesurfer.fm/example/microphone) used for realtime visualization of the microphone audio signal.
- [videojs-wavesurfer](https://github.com/collab-project/videojs-wavesurfer) - Turns Video.js into an audio-player.

Using the Plugin
----------------

Whether you're going to record audio or video, or both, you'll always need
video.js and recordrtc.js. Start by including the following:

```html
<link href="http://cdnjs.cloudflare.com/ajax/libs/video.js/4.11.3/video-js.css" rel="stylesheet">

<script src="http://cdnjs.cloudflare.com/ajax/libs/video.js/4.11.3/video.js"></script>
<script src="http://recordrtc.org/latest.js"></script>
```

The videojs-record plugin automatically registers itself when the script
is included on the page:

```html
<script src="videojs.record.js"></script>
```

Add the extra stylesheet that includes a
[custom font](src/css/font) with additional icons:

```html
<link href="videojs.record.css" rel="stylesheet">
```

### Audio/video

When recording both audio/video, or video-only, include a
`video` element:

```html
<video id="myVideo" class="video-js vjs-default-skin"></video>
```

Check out the full [audio/video](examples/audio-video.html "audio/video example") or
[video-only](examples/video-only.html "video-only example") examples.

### Audio-only

![Audio-only screenshot](examples/img/audio-only.png?raw=true "Audio-only screenshot")

When recording audio-only, also include the wavesurfer.js library and
the videojs-wavesurfer and microphone plugins. Make sure to place this before
the `videojs.record.js` script.

```html
<script src="http://wavesurfer.fm/build/wavesurfer.min.js"></script>
<script src="http://wavesurfer.fm/plugin/wavesurfer.microphone.js"></script>
<script src="videojs.wavesurfer.js"></script>
```

And define an `audio` element:

```html
<audio id="myAudio" class="video-js vjs-default-skin"></audio>
```

Check out the full [audio-only](examples/audio-only.html "audio-only example")
example.

Plugin options
--------------

Configure the player using the video.js
[options](https://github.com/videojs/video.js/blob/master/docs/guides/options.md),
and enable the plugin by adding a `record` entry. For example:

```javascript
var player = videojs("myVideo",
{
    controls: true,
    loop: false,
    width: 320,
    height: 240,
    plugins: {
        record: {
            audio: false,
            video: true,
            maxLength: 5
        }
    }
});
```

The available options for this plugin are:

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `audio` | boolean | `false` | Include audio in the recorded clip. |
| `video` | boolean | `true` | Include video in the recorded clip. |
| `maxLength` | float | `10` | Maximum length of the recorded clip. |
| `audioBufferSize` | float | `4096` | The size of the audio buffer (in sample-frames per second). Legal values: 256, 512, 1024, 2048, 4096, 8192 and 16384. |
| `audioSampleRate` | float | `22050` | The audio sample rate (in sample-frames per second) at which the `AudioContext` handles audio. Legal values are in the range of 22050 to 96000. |
<commit_msg>document some of the plugin methods<commit_after>Video.js Record
===============

A Video.js plugin for recording audio/video files.

![Screenshot](examples/img/screenshot.png?raw=true "Screenshot")

Installation
------------

Use [bower](http://bower.io) (`bower install videojs-record`) or
[npm](https://www.npmjs.org) (`npm install videojs-record`) to install
the plugin or download and include the dependencies manually.

The plugin has the following mandatory dependencies:

- [Video.js](http://www.videojs.com) - HTML5 media player that provides the user interface.
- [RecordRTC.js](http://recordrtc.org) - Adds support for audio/video recording.

When recording audio-only, the following dependencies are also required:

- [wavesurfer.js](https://github.com/katspaugh/wavesurfer.js) - Provides a navigable waveform for audio files. Comes with a [microphone plugin](http://www.wavesurfer.fm/example/microphone) used for realtime visualization of the microphone audio signal.
- [videojs-wavesurfer](https://github.com/collab-project/videojs-wavesurfer) - Turns Video.js into an audio-player.

Using the Plugin
----------------

Whether you're going to record audio or video, or both, you'll always need
video.js and recordrtc.js. Start by including the following:

```html
<link href="http://cdnjs.cloudflare.com/ajax/libs/video.js/4.11.3/video-js.css" rel="stylesheet">

<script src="http://cdnjs.cloudflare.com/ajax/libs/video.js/4.11.3/video.js"></script>
<script src="http://recordrtc.org/latest.js"></script>
```

The videojs-record plugin automatically registers itself when the script
is included on the page:

```html
<script src="videojs.record.js"></script>
```

Add the extra stylesheet that includes a
[custom font](src/css/font) with additional icons:

```html
<link href="videojs.record.css" rel="stylesheet">
```

### Audio/video

When recording both audio/video, or video-only, include a
`video` element:

```html
<video id="myVideo" class="video-js vjs-default-skin"></video>
```

Check out the full [audio/video](examples/audio-video.html "audio/video example") or
[video-only](examples/video-only.html "video-only example") examples.

### Audio-only

![Audio-only screenshot](examples/img/audio-only.png?raw=true "Audio-only screenshot")

When recording audio-only, also include the wavesurfer.js library and
the videojs-wavesurfer and microphone plugins. Make sure to place this before
the `videojs.record.js` script.

```html
<script src="http://wavesurfer.fm/build/wavesurfer.min.js"></script>
<script src="http://wavesurfer.fm/plugin/wavesurfer.microphone.js"></script>
<script src="videojs.wavesurfer.js"></script>
```

And define an `audio` element:

```html
<audio id="myAudio" class="video-js vjs-default-skin"></audio>
```

Check out the full [audio-only](examples/audio-only.html "audio-only example")
example.

Plugin options
--------------

Configure the player using the video.js
[options](https://github.com/videojs/video.js/blob/master/docs/guides/options.md),
and enable the plugin by adding a `record` entry. For example:

```javascript
var player = videojs("myVideo",
{
    controls: true,
    loop: false,
    width: 320,
    height: 240,
    plugins: {
        record: {
            audio: false,
            video: true,
            maxLength: 5
        }
    }
});
```

The available options for this plugin are:

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `audio` | boolean | `false` | Include audio in the recorded clip. |
| `video` | boolean | `true` | Include video in the recorded clip. |
| `maxLength` | float | `10` | Maximum length of the recorded clip. |
| `audioBufferSize` | float | `4096` | The size of the audio buffer (in sample-frames per second). Legal values: 256, 512, 1024, 2048, 4096, 8192 and 16384. |
| `audioSampleRate` | float | `22050` | The audio sample rate (in sample-frames per second) at which the `AudioContext` handles audio. Legal values are in the range of 22050 to 96000. |

Plugin methods
-------------

Methods for this plugin:

| Method | Description |
| --- | --- |
| `isRecording` | Returns a boolean indicating whether recording is active or not. |
| `getRecordType` | Get recorder type as string, either `audio_only', `video_only` or `audio_video`. |
| `destroy` | Destroys the recorder instance and children. |

{'fraction_non_alphanumeric': 0.15228671413056594, 'fraction_numerical': 0.015445879087727767, 'mean_word_length': 3.98676293622142, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 8, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2384038', 'n_tokens_mistral': 2704, 'n_tokens_neox': 2483, 'n_words': 774}