<commit_before># API Reference
<a name="screencastify"></a>
## screencastify

* [screencastify](#screencastify)
  * _static_
    * [.Recorder()](#screencastify.Recorder)
      * [.state](#screencastify.Recorder+state) : <code>String</code>
      * [.state](#screencastify.Recorder+state) : <code>number</code>
      * [.onStateChanged](#screencastify.Recorder+onStateChanged) : <code>function</code>
      * [.onTimeChanged](#screencastify.Recorder+onTimeChanged) : <code>function</code>
      * [.start(config)](#screencastify.Recorder+start) ⇒ <code>Promise</code>
      * [.stop()](#screencastify.Recorder+stop) ⇒ <code>Promise</code>
      * [.pause()](#screencastify.Recorder+pause) ⇒ <code>Promise</code>
      * [.resume()](#screencastify.Recorder+resume) ⇒ <code>Promise</code>
    * [.isAppConnected()](#screencastify.isAppConnected) ⇒ <code>Promise</code>
    * [.getFile(fileId)](#screencastify.getFile) ⇒ <code>Promise</code>
    * [.connectApp()](#screencastify.connectApp) ⇒ <code>Promise</code>
    * [.isBrowserSupported()](#screencastify.isBrowserSupported) ⇒ <code>boolean</code>
    * [.isInstalled()](#screencastify.isInstalled) ⇒ <code>String</code>
    * [.decodeStateQuery([search])](#screencastify.decodeStateQuery) ⇒ <code>Object</code>
    * [.setAppId(id)](#screencastify.setAppId)
  * _inner_
    * [~AudioConfig](#screencastify..AudioConfig) : <code>Object</code>
    * [~RecordConfig](#screencastify..RecordConfig) : <code>Object</code>
    * [~StartConfig](#screencastify..StartConfig) : <code>Object</code>

<a name="screencastify.Recorder"></a>
### screencastify.Recorder()
Recorder controller.

**Params**


  * [.Recorder()](#screencastify.Recorder)
    * [.state](#screencastify.Recorder+state) : <code>String</code>
    * [.state](#screencastify.Recorder+state) : <code>number</code>
    * [.onStateChanged](#screencastify.Recorder+onStateChanged) : <code>function</code>
    * [.onTimeChanged](#screencastify.Recorder+onTimeChanged) : <code>function</code>
    * [.start(config)](#screencastify.Recorder+start) ⇒ <code>Promise</code>
    * [.stop()](#screencastify.Recorder+stop) ⇒ <code>Promise</code>
    * [.pause()](#screencastify.Recorder+pause) ⇒ <code>Promise</code>
    * [.resume()](#screencastify.Recorder+resume) ⇒ <code>Promise</code>

<a name="screencastify.Recorder+state"></a>
#### recorder.state : <code>String</code>
Current recorder state. String out of ['inactive', 'recording', 'paused'].

<a name="screencastify.Recorder+state"></a>
#### recorder.state : <code>number</code>
Current recorder time in seconds.

<a name="screencastify.Recorder+onStateChanged"></a>
#### recorder.onStateChanged : <code>function</code>
Set this property to a function to get notified when the recorder state changed.
It's called with the new state as the only argument.

**Example**  
```js
recorder.onStateChanged = function(state) {
   console.log('state changed to', state);
 }
```
<a name="screencastify.Recorder+onTimeChanged"></a>
#### recorder.onTimeChanged : <code>function</code>
Set this property to a function to get notified when the recorder time changed.
It's called with the new time as the only argument.

**Example**  
```js
recorder.onTimeChanged = function(time) {
   console.log('time changed to', time);
 }
```
<a name="screencastify.Recorder+start"></a>
#### recorder.start(config) ⇒ <code>Promise</code>
Start recording.

**Returns**: <code>Promise</code> - resolves when recording has been started / rejects on errors.  
**Params**
- config <code>StartConfig</code> - recording configuration.

**Example**  
```js
var recorder = new screencastify.Recorder();
recorder.start({
    shareUrl: location.href,  // handle shared file on same page
    payload: 'some string',
    recordingConfig: {
      audio: {mic: true}
    }
  }).then(function() {
  console.log('recording started');
});
```
<a name="screencastify.Recorder+stop"></a>
#### recorder.stop() ⇒ <code>Promise</code>
Stop recording.

**Returns**: <code>Promise</code> - resolves when recording has been stopped / rejects on errors.  
<a name="screencastify.Recorder+pause"></a>
#### recorder.pause() ⇒ <code>Promise</code>
Pause recording.

**Returns**: <code>Promise</code> - resolves when recording has been paused / rejects on errors.  
<a name="screencastify.Recorder+resume"></a>
#### recorder.resume() ⇒ <code>Promise</code>
Resume recording after it has been paused.

**Returns**: <code>Promise</code> - resolves when recording has been resumed / rejects on errors.  
<a name="screencastify.isAppConnected"></a>
### screencastify.isAppConnected() ⇒ <code>Promise</code>
Check if App is connected. Returns false if platform is unsupported or extension not
installed.

**Returns**: <code>Promise</code> - that resolves with boolean result.  
<a name="screencastify.getFile"></a>
### screencastify.getFile(fileId) ⇒ <code>Promise</code>
Get metadata of given file id.

**Returns**: <code>Promise</code> - resolves with object.  
**Params**
- fileId <code>String</code> - file id.

**Example**  
```js
screencastify.getFile('shared-file-id').then(function(fileInfo) {
 fileInfo = {
  duration: 150.4,  // in seconds, undefined if unknown
  file: File,
  height: 600,  // undefined if unknown
  width: 800,  // undefined if unknown
  id: 'shared-file-id',
  title: 'Test Name'  // file title set by user
  payload: 'some string '  // string set with recorder.start()
});
```
<a name="screencastify.connectApp"></a>
### screencastify.connectApp() ⇒ <code>Promise</code>
Connect your App to Screencastify.
This opens a popup window, so only call this in event handlers.
It takes care of installing Screencastify first, if it is not installed yet.

**Returns**: <code>Promise</code> - it returns a Promise that resolves on success or rejects on error.  
<a name="screencastify.isBrowserSupported"></a>
### screencastify.isBrowserSupported() ⇒ <code>boolean</code>
Check if browser is supported.

**Returns**: <code>boolean</code> - true if supported.  
<a name="screencastify.isInstalled"></a>
### screencastify.isInstalled() ⇒ <code>String</code>
Check if extension is installed.

**Returns**: <code>String</code> - version if installed, false else.  
<a name="screencastify.decodeStateQuery"></a>
### screencastify.decodeStateQuery([search]) ⇒ <code>Object</code>
Get decoded state query parameter.

**Returns**: <code>Object</code> - decoded state object or null.  <commit_msg>Fix isInstalled() doc<commit_after># API Reference
<a name="screencastify"></a>
## screencastify

* [screencastify](#screencastify)
  * _static_
    * [.Recorder()](#screencastify.Recorder)
      * [.state](#screencastify.Recorder+state) : <code>String</code>
      * [.state](#screencastify.Recorder+state) : <code>number</code>
      * [.onStateChanged](#screencastify.Recorder+onStateChanged) : <code>function</code>
      * [.onTimeChanged](#screencastify.Recorder+onTimeChanged) : <code>function</code>
      * [.start(config)](#screencastify.Recorder+start) ⇒ <code>Promise</code>
      * [.stop()](#screencastify.Recorder+stop) ⇒ <code>Promise</code>
      * [.pause()](#screencastify.Recorder+pause) ⇒ <code>Promise</code>
      * [.resume()](#screencastify.Recorder+resume) ⇒ <code>Promise</code>
    * [.isAppConnected()](#screencastify.isAppConnected) ⇒ <code>Promise</code>
    * [.getFile(fileId)](#screencastify.getFile) ⇒ <code>Promise</code>
    * [.connectApp()](#screencastify.connectApp) ⇒ <code>Promise</code>
    * [.isBrowserSupported()](#screencastify.isBrowserSupported) ⇒ <code>boolean</code>
    * [.isInstalled()](#screencastify.isInstalled) ⇒ <code>Promise</code>
    * [.decodeStateQuery([search])](#screencastify.decodeStateQuery) ⇒ <code>Object</code>
    * [.setAppId(id)](#screencastify.setAppId)
  * _inner_
    * [~AudioConfig](#screencastify..AudioConfig) : <code>Object</code>
    * [~RecordConfig](#screencastify..RecordConfig) : <code>Object</code>
    * [~StartConfig](#screencastify..StartConfig) : <code>Object</code>

<a name="screencastify.Recorder"></a>
### screencastify.Recorder()
Recorder controller.

**Params**


  * [.Recorder()](#screencastify.Recorder)
    * [.state](#screencastify.Recorder+state) : <code>String</code>
    * [.state](#screencastify.Recorder+state) : <code>number</code>
    * [.onStateChanged](#screencastify.Recorder+onStateChanged) : <code>function</code>
    * [.onTimeChanged](#screencastify.Recorder+onTimeChanged) : <code>function</code>
    * [.start(config)](#screencastify.Recorder+start) ⇒ <code>Promise</code>
    * [.stop()](#screencastify.Recorder+stop) ⇒ <code>Promise</code>
    * [.pause()](#screencastify.Recorder+pause) ⇒ <code>Promise</code>
    * [.resume()](#screencastify.Recorder+resume) ⇒ <code>Promise</code>

<a name="screencastify.Recorder+state"></a>
#### recorder.state : <code>String</code>
Current recorder state. String out of ['inactive', 'recording', 'paused'].

<a name="screencastify.Recorder+state"></a>
#### recorder.state : <code>number</code>
Current recorder time in seconds.

<a name="screencastify.Recorder+onStateChanged"></a>
#### recorder.onStateChanged : <code>function</code>
Set this property to a function to get notified when the recorder state changed.
It's called with the new state as the only argument.

**Example**  
```js
recorder.onStateChanged = function(state) {
   console.log('state changed to', state);
 }
```
<a name="screencastify.Recorder+onTimeChanged"></a>
#### recorder.onTimeChanged : <code>function</code>
Set this property to a function to get notified when the recorder time changed.
It's called with the new time as the only argument.

**Example**  
```js
recorder.onTimeChanged = function(time) {
   console.log('time changed to', time);
 }
```
<a name="screencastify.Recorder+start"></a>
#### recorder.start(config) ⇒ <code>Promise</code>
Start recording.

**Returns**: <code>Promise</code> - resolves when recording has been started / rejects on errors.  
**Params**
- config <code>StartConfig</code> - recording configuration.

**Example**  
```js
var recorder = new screencastify.Recorder();
recorder.start({
    shareUrl: location.href,  // handle shared file on same page
    payload: 'some string',
    recordingConfig: {
      audio: {mic: true}
    }
  }).then(function() {
  console.log('recording started');
});
```
<a name="screencastify.Recorder+stop"></a>
#### recorder.stop() ⇒ <code>Promise</code>
Stop recording.

**Returns**: <code>Promise</code> - resolves when recording has been stopped / rejects on errors.  
<a name="screencastify.Recorder+pause"></a>
#### recorder.pause() ⇒ <code>Promise</code>
Pause recording.

**Returns**: <code>Promise</code> - resolves when recording has been paused / rejects on errors.  
<a name="screencastify.Recorder+resume"></a>
#### recorder.resume() ⇒ <code>Promise</code>
Resume recording after it has been paused.

**Returns**: <code>Promise</code> - resolves when recording has been resumed / rejects on errors.  
<a name="screencastify.isAppConnected"></a>
### screencastify.isAppConnected() ⇒ <code>Promise</code>
Check if App is connected. Returns false if platform is unsupported or extension not
installed.

**Returns**: <code>Promise</code> - that resolves with boolean result.  
<a name="screencastify.getFile"></a>
### screencastify.getFile(fileId) ⇒ <code>Promise</code>
Get metadata of given file id.

**Returns**: <code>Promise</code> - resolves with object.  
**Params**
- fileId <code>String</code> - file id.

**Example**  
```js
screencastify.getFile('shared-file-id').then(function(fileInfo) {
 fileInfo = {
  duration: 150.4,  // in seconds, undefined if unknown
  file: File,
  height: 600,  // undefined if unknown
  width: 800,  // undefined if unknown
  id: 'shared-file-id',
  title: 'Test Name'  // file title set by user
  payload: 'some string '  // string set with recorder.start()
});
```
<a name="screencastify.connectApp"></a>
### screencastify.connectApp() ⇒ <code>Promise</code>
Connect your App to Screencastify.
This opens a popup window, so only call this in event handlers.
It takes care of installing Screencastify first, if it is not installed yet.

**Returns**: <code>Promise</code> - it returns a Promise that resolves on success or rejects on error.  
<a name="screencastify.isBrowserSupported"></a>
### screencastify.isBrowserSupported() ⇒ <code>boolean</code>
Check if browser is supported.

**Returns**: <code>boolean</code> - true if supported.  
<a name="screencastify.isInstalled"></a>
### screencastify.isInstalled() ⇒ <code>Promise</code>
Check if extension is installed.

**Returns**: <code>Promise</code> - that resolves with a version string if installed, false else.  
<a name="screencastify.decodeStateQuery"></a>
### screencastify.decodeStateQuery([search]) ⇒ <code>Object</code>
Get decoded state query parameter.

**Returns**: <code>Object</code> - decoded state object or null.  
{'fraction_non_alphanumeric': 0.1739468971424122, 'fraction_numerical': 0.0015572685509616132, 'mean_word_length': 5.139579349904397, 'pattern_counts': {'":': 0, '<': 271, '<?xml version=': 0, '>': 271, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5223593', 'n_tokens_mistral': 4426, 'n_tokens_neox': 4189, 'n_words': 945}