Skip to content

Commit

Permalink
feat(streaming-media): add new parameters & docs (#2576)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamilovtim authored and danielsogl committed Jul 2, 2018
1 parent 8e1ca35 commit f62a123
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/@ionic-native/plugins/streaming-media/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,48 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';

/**
* Object of options to pass into the playVideo method.
*/
export interface StreamingVideoOptions {
/** Executes after success playing audio. */
successCallback?: Function;
/** Executes after error playing video. */
errorCallback?: Function;
/** Force one orientation for playing video. */
orientation?: string;
/** Should the video close after it's over. Defaults to true. */
shouldAutoClose?: boolean;
/** Should the video have controls. Defaults to true. Android only. */
controls?: boolean;
}

/**
* Object of options to pass into the playAudio method.
*/
export interface StreamingAudioOptions {
/** Background color for audio player. */
bgColor?: string;
/** Background image for audio player. */
bgImage?: string;
/**
* Background image scale for audio player.
* Valid values are:
* fit
* stretch
* aspectStretch.
*/
bgImageScale?: string;
/** Start audio player in full screen. iOS only. */
initFullscreen?: boolean;
/**
* Keeps the screen lit and stops it from locking
* while audio is playing. Android only.
*/
keepAwake?: boolean;
/** Executes after success playing audio. */
successCallback?: Function;
/** Executes after error playing audio. */
errorCallback?: Function;
}

Expand All @@ -30,7 +60,9 @@ export interface StreamingAudioOptions {
* let options: StreamingVideoOptions = {
* successCallback: () => { console.log('Video played') },
* errorCallback: (e) => { console.log('Error streaming') },
* orientation: 'landscape'
* orientation: 'landscape',
* shouldAutoClose: true,
* controls: false
* };
*
* this.streamingMedia.playVideo('https://path/to/video/stream', options);
Expand Down

0 comments on commit f62a123

Please sign in to comment.