awesome-cordova-plugins/src/plugins/streaming-media.ts
Ramon Henrique Ornelas 54460e2362 style(): fix angular styles (#512)
* style(canva-camera): fix angular style

* style(crop): fix angular style

* style(file-chooser): fix angular style

* style(file-opener): fix angular style

* style(file): fix angular style

* style(inappbrowser): fix angular style

* style(instagram): fix angular style

* style(is-debug): fix angular style

* style(native-page-transitions): fix angular style

* style(market): fix angular style

* style(music-controls): fix angular style

* style(nfc): fix angular style

* style(pay-pal): fix angular style

* style(power-management): fix angular style

* style(securestorage): fix angular style

* style(streaming-media): fix angular style

* style(video-editor): fix angular style

* style(youtube-video-player): fix angular style
2016-08-31 17:02:15 -04:00

78 lines
1.9 KiB
TypeScript

import { Plugin, Cordova } from './plugin';
/**
* @name StreamingMedia
* @description
* This plugin allows you to stream audio and video in a fullscreen, native player on iOS and Android.
*
* @usage
* ```
* import {StreamingMedia, StreamingVideoOptions} from 'ionic-native';
*
* let options: StreamingVideoOptions = {
* successCallback: () => { console.log('Video played') },
* errorCallback: (e) => { console.log('Error streaming') },
* orientation: 'landscape'
* };
*
* StreamingMedia.('https://path/to/video/stream', options);
*
* ```
*/
@Plugin({
plugin: 'cordova-plugin-streaming-media',
pluginRef: 'plugins.streamingMedia',
repo: 'https://github.com/nchutchind/cordova-plugin-streaming-media',
platforms: ['Android', 'iOS']
})
export class StreamingMedia {
/**
* Streams a video
* @param videoUrl {string} The URL of the video
* @param options {StreamingVideoOptions} Options
*/
@Cordova({sync: true})
static playVideo(videoUrl: string, options?: StreamingVideoOptions): void { }
/**
* Streams an audio
* @param audioUrl {string} The URL of the audio stream
* @param options {StreamingAudioOptions} Options
*/
@Cordova({sync: true})
static playAudio(audioUrl: string, options?: StreamingAudioOptions): void { }
/**
* Stops streaming audio
*/
@Cordova({sync: true})
static stopAudio(): void { }
/**
* Pauses streaming audio
*/
@Cordova({sync: true, platforms: ['iOS']})
static pauseAudio(): void { }
/**
* Resumes streaming audio
*/
@Cordova({sync: true, platforms: ['iOS']})
static resumeAudio(): void { }
}
export interface StreamingVideoOptions {
successCallback?: Function;
errorCallback?: Function;
orientation?: string;
}
export interface StreamingAudioOptions {
bgColor?: string;
bgImage?: string;
bgImageScale?: string;
initFullscreen?: boolean;
successCallback?: Function;
errorCallback?: Function;
}