mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 08:32:52 +08:00
Merge branch 'master' of github.com:ionic-team/ionic-native
This commit is contained in:
commit
5072c99938
@ -58,7 +58,9 @@ export interface MusicControlsOptions {
|
|||||||
*
|
*
|
||||||
* this.musicControls.subscribe().subscribe(action => {
|
* this.musicControls.subscribe().subscribe(action => {
|
||||||
*
|
*
|
||||||
* switch(action) {
|
* function events(action) {
|
||||||
|
* const message = JSON.parse(action).message;
|
||||||
|
* switch(message) {
|
||||||
* case 'music-controls-next':
|
* case 'music-controls-next':
|
||||||
* // Do something
|
* // Do something
|
||||||
* break;
|
* break;
|
||||||
@ -75,7 +77,21 @@ export interface MusicControlsOptions {
|
|||||||
* // Do something
|
* // Do something
|
||||||
* break;
|
* break;
|
||||||
*
|
*
|
||||||
|
* // External controls (iOS only)
|
||||||
|
* case 'music-controls-toggle-play-pause' :
|
||||||
|
* // Do something
|
||||||
|
* break;
|
||||||
|
* case 'music-controls-seek-to':
|
||||||
|
* const seekToInSeconds = JSON.parse(action).position;
|
||||||
|
* MusicControls.updateElapsed({
|
||||||
|
* elapsed: seekToInSeconds,
|
||||||
|
* isPlaying: true
|
||||||
|
* });
|
||||||
|
* // Do something
|
||||||
|
* break;
|
||||||
|
*
|
||||||
* // Headset events (Android only)
|
* // Headset events (Android only)
|
||||||
|
* // All media button events are listed below
|
||||||
* case 'music-controls-media-button' :
|
* case 'music-controls-media-button' :
|
||||||
* // Do something
|
* // Do something
|
||||||
* break;
|
* break;
|
||||||
@ -88,8 +104,7 @@ export interface MusicControlsOptions {
|
|||||||
* default:
|
* default:
|
||||||
* break;
|
* break;
|
||||||
* }
|
* }
|
||||||
*
|
* }
|
||||||
* });
|
|
||||||
*
|
*
|
||||||
* this.musicControls.listen(); // activates the observable above
|
* this.musicControls.listen(); // activates the observable above
|
||||||
*
|
*
|
||||||
@ -147,6 +162,15 @@ export class MusicControls extends IonicNativePlugin {
|
|||||||
@Cordova()
|
@Cordova()
|
||||||
updateIsPlaying(isPlaying: boolean): void { }
|
updateIsPlaying(isPlaying: boolean): void { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update elapsed time, optionally toggle play/pause:
|
||||||
|
* @param args {elapsed: string, isPlaying: boolean}
|
||||||
|
*/
|
||||||
|
@Cordova({
|
||||||
|
platforms: ['iOS']
|
||||||
|
})
|
||||||
|
updateElapsed(args: object): void { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle dismissable:
|
* Toggle dismissable:
|
||||||
* @param dismissable {boolean}
|
* @param dismissable {boolean}
|
||||||
|
Loading…
Reference in New Issue
Block a user