From 2c1963ff00b508911192b75edbb9b82ba497feb3 Mon Sep 17 00:00:00 2001 From: Timothy Shamilov Date: Thu, 28 Jun 2018 03:48:28 -0400 Subject: [PATCH] feat(streaming-media): add new parameters & docs --- .../plugins/streaming-media/index.ts | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/streaming-media/index.ts b/src/@ionic-native/plugins/streaming-media/index.ts index 6fb18f53cf..e3650cb12b 100644 --- a/src/@ionic-native/plugins/streaming-media/index.ts +++ b/src/@ionic-native/plugins/streaming-media/index.ts @@ -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; } @@ -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);