fix(music-controls): various fixes (#2094)

Add hasScrubbing variable to options - used to enable or disable scrubbing from the iOS control center or lockscreen progress bar
Make optional items actually optional...
This commit is contained in:
Gaven Henry 2017-12-09 03:56:12 +08:00 committed by Ibby Hadeed
parent 5159367db8
commit afca8761d7

View File

@ -3,22 +3,23 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface MusicControlsOptions {
track: string;
artist: string;
cover: string;
isPlaying: boolean;
dismissable: boolean;
hasPrev: boolean;
hasNext: boolean;
hasSkipForward: boolean;
hasSkipBackward: boolean;
skipForwardInterval: number;
skipBackwardInterval: number;
hasClose: boolean;
album: string;
duration: number;
elapsed: number;
ticker: string;
track?: string;
artist?: string;
cover?: string;
isPlaying?: boolean;
dismissable?: boolean;
hasPrev?: boolean;
hasNext?: boolean;
hasSkipForward?: boolean;
hasSkipBackward?: boolean;
skipForwardInterval?: number;
skipBackwardInterval?: number;
hasScrubbing?: boolean;
hasClose?: boolean;
album?: string;
duration?: number;
elapsed?: number;
ticker?: string;
}
/**
@ -58,9 +59,10 @@ export interface MusicControlsOptions {
* hasSkipBackward : true, // show skip backward button, optional, default: false
* skipForwardInterval: 15, // display number for skip forward, optional, default: 0
* skipBackwardInterval: 15, // display number for skip backward, optional, default: 0
* hasScrubbing: false, // enable scrubbing from control center and lockscreen progress bar, optional
*
* // Android only, optional
* // text displayed in the status bar when the notification (and the ticker) are updated
* // text displayed in the status bar when the notification (and the ticker) are updated, optional
* ticker : 'Now playing "Time is Running Out"'
* });
*
@ -91,7 +93,7 @@ export interface MusicControlsOptions {
* break;
* case 'music-controls-seek-to':
* const seekToInSeconds = JSON.parse(action).position;
* MusicControls.updateElapsed({
* this.musicControls.updateElapsed({
* elapsed: seekToInSeconds,
* isPlaying: true
* });