# cordova-plugin-streaming-native

> This plugin allows you to stream audio and video in a fullscreen, native player on iOS and Android.

Latest version **1.0.1** (published 2018-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-streaming-native
pnpm add cordova-plugin-streaming-native
yarn add cordova-plugin-streaming-native
bun add cordova-plugin-streaming-native
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-10-17 |
| First published | 2018-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 32.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | João Vitor Duarte Mariucio |
| Maintainers | joaoduartemariucio |
| Keywords | media, streaming, ecosystem:cordova, cordova-ios, cordova-android, cordova-fireos |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-streaming-native
- Repository: https://github.com/joaoduartemariucio/cordova-plugin-streaming-native
- Homepage: https://github.com/joaoduartemariucio/cordova-plugin-streaming-native#readme
- Issues: https://github.com/joaoduartemariucio/cordova-plugin-streaming-native/issues
- npm.io page: https://npm.io/package/cordova-plugin-streaming-native

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-10-17

## README

# Credits

Stuart McCamley & Nicholas Hutchind 

## Description

This plugin allows you to stream audio and video in a fullscreen, native player on iOS and Android.

* 1.0.0 Works with Cordova 3.x
* 1.0.1+ Works with Cordova >= 4.0

## Installation

```
cordova plugin add https://github.com/joaoduartemariucio/cordova-plugin-streaming-native.git
```

### iOS specifics
* Uses the Swift MediaPlayer.
* Tested on iOS 10.x
* Works on iOS 12

### Android specifics
* Uses VideoView and MediaPlayer.
* Creates two activities in your AndroidManifest.xml file.
* Tested on Android 4.0+

## Play streaming
```javascript
if(window && window.plugins && window.plugins.streamingMedia) {
  let StreamingMedia = window.plugins.streamingMedia
  StreamingMedia.playiOS('url')
}
```
## Play file local
```javascript
if(window && window.plugins && window.plugins.streamingMedia) {
  let StreamingMedia = window.plugins.streamingMedia
  StreamingMedia.playLocaliOS("local file path")
}
```
## PlayList of urls
```javascript
if(window && window.plugins && window.plugins.streamingMedia) {
  let StreamingMedia = window.plugins.streamingMedia
  StreamingMedia.playPlaylist("array to urls")
}
```

## Usage Andoird

```javascript
  var videoUrl = STREAMING_VIDEO_URL;

  // Just play a video
  window.plugins.streamingMedia.playVideo(videoUrl);

  // Play a video with callbacks
  var options = {
    successCallback: function() {
      console.log("Video was closed without error.");
    },
    errorCallback: function(errMsg) {
      console.log("Error! " + errMsg);
    },
    orientation: 'landscape',
    shouldAutoClose: true,  // true(default)/false
    controls: true // true(default)/false. Used to hide controls on fullscreen
  };
  window.plugins.streamingMedia.playVideo(videoUrl, options);


  var audioUrl = STREAMING_AUDIO_URL;

  // Play an audio file (not recommended, since the screen will be plain black)
  window.plugins.streamingMedia.playAudio(audioUrl);

  // Play an audio file with options (all options optional)
  var options = {
    bgColor: "#FFFFFF",
    bgImage: "<SWEET_BACKGROUND_IMAGE>",
    bgImageScale: "fit", // other valid values: "stretch"
    initFullscreen: false, // true(default)/false iOS only
    successCallback: function() {
      console.log("Player closed without error.");
    },
    errorCallback: function(errMsg) {
      console.log("Error! " + errMsg);
    }
  };
  window.plugins.streamingMedia.playAudio(audioUrl, options);

  // Stop current audio
  window.plugins.streamingMedia.stopAudio();

  // Pause current audio (iOS only)
  window.plugins.streamingMedia.pauseAudio();

  // Resume current audio (iOS only)
  window.plugins.streamingMedia.resumeAudio();  

```

---
_Source: https://npm.io/package/cordova-plugin-streaming-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
