<commit_before>Video Player plugin for Cordova/PhoneGap
========================================

A Codova plugin that simply allows you to immediately play a video in fullscreen mode.


# Installation

This plugin use the Cordova CLI's plugin command. To install it to your application, simply execute the following (and replace variables).

```
cordova plugin add com.moust.cordova.videoplayer
```


# Using

Just call the  `load` method with a video file path as argument, and then `start`. The video player will close itself when the video will be completed.

```
VideoPlayer.load(path, [options], [completeCallback], [errorCallback]);
```

Start playing video.
```
VideoPlayer.start();
```

Stop and close a video currently playing without waiting the end.
```
VideoPlayer.close();
```
Get duration of video in milliseconds.
```
VideoPlayer.getDuration(callback);
```
Get position of currently playing video.
```
VideoPlayer.getCurrentPosition(callback);
```
Select audio track.
```
VideoPlayer.selectAudioTracle(index);
```

The plugin is able to play file-path or http/rtsp URL.

You can optionally add options parameters like volume and calling mode.
You can also add an success callback function to handle completed playback.
You can also add an error callback function to handle unexpected playback errors.

## Example

```javascript
VideoPlayer.load("file:///android_asset/www/movie.mp4");
VideoPlayer.start();
```

```javascript
VideoPlayer.play(
    "file:///android_asset/www/movie.mp4",
    {
        volume: 0.5,
        scalingMode: VideoPlayer.SCALING_MODE.SCALE_TO_FIT_WITH_CROPPING
    },
    function (evt) {
	try {
		event = JSON.parse(event);
	} catch(e) {}

	if(event.event == 'prepared') {
		VideoPlayer.selectAudioTrack(event.audio_tracks[0].index);
	        VideoPlayer.start();
	}

        console.log("Event: " + evt);
    },
    function (err) {
        console.log(err);
    }<commit_msg>Correct README.md<commit_after>Video Player plugin for Cordova/PhoneGap
========================================

A Codova plugin that simply allows you to immediately play a video in fullscreen mode.


# Installation

This plugin use the Cordova CLI's plugin command. To install it to your application, simply execute the following (and replace variables).

```
cordova plugin add com.moust.cordova.videoplayer
```


# Using

Just call the  `load` method with a video file path as argument, and then `start`. The video player will close itself when the video will be completed.

```
VideoPlayer.load(path, [options], [completeCallback], [errorCallback]);
```

Start playing video.
```
VideoPlayer.start();
```

Stop and close a video currently playing without waiting the end.
```
VideoPlayer.close();
```
Get duration of video in milliseconds.
```
VideoPlayer.getDuration(callback);
```
Get position of currently playing video.
```
VideoPlayer.getCurrentPosition(callback);
```
Select audio track.
```
VideoPlayer.selectAudioTracle(index);
```

The plugin is able to play file-path or http/rtsp URL.

You can optionally add options parameters like volume and calling mode.
You can also add an success callback function to handle completed playback.
You can also add an error callback function to handle unexpected playback errors.

## Example

```javascript
VideoPlayer.load("file:///android_asset/www/movie.mp4");
VideoPlayer.start();
```

```javascript
VideoPlayer.load(
    "file:///android_asset/www/movie.mp4",
    {
        volume: 0.5,
        scalingMode: VideoPlayer.SCALING_MODE.SCALE_TO_FIT_WITH_CROPPING
    },
    function (evt) {
	try {
		event = JSON.parse(event);
	} catch(e) {}

	if(event.event == 'prepared') {
		VideoPlayer.selectAudioTrack(event.audio_tracks[0].index);
	        VideoPlayer.start();
	}

        console.log("Event: " + evt);
    },
    function (err) {
        console.log(err);
    }
{'fraction_non_alphanumeric': 0.13092139510671524, 'fraction_numerical': 0.0026028110359187923, 'mean_word_length': 4.242837653478854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '388746', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1071, 'n_words': 369}