Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play works but pause doesn't on ios11 #130

Open
area809 opened this issue Jun 29, 2018 · 2 comments
Open

Play works but pause doesn't on ios11 #130

area809 opened this issue Jun 29, 2018 · 2 comments

Comments

@area809
Copy link

area809 commented Jun 29, 2018

for some reason the plugin works fine, but the play button does work while the pause does nothing... any idea how to fix?

thanks

@rowanvi
Copy link

rowanvi commented Jul 2, 2018

Can you share some of your code snippets of the play and pause methods?

@area809
Copy link
Author

area809 commented Jul 21, 2018

music(track) {
this.musicControls.updateDismissable(true);

//this.musicControls.destroy();
this.musicControls.create({
  track: track.title, // optional, default : ''
  artist: track.artist, // optional, default : ''
  cover: track.art, // optional, default : nothing
  // cover can be a local path (use fullpath 'file:///storage/emulated/...', or only 'my_image.jpg' if my_image.jpg is in the www folder of your app)
  //           or a remote url ('http://...', 'https://...', 'ftp://...')
  isPlaying: true, // optional, default : true
  dismissable: true, // optional, default : false

  // hide previous/next/close buttons:
  hasPrev: true, // show previous button, optional, default: true
  hasNext: true, // show next button, optional, default: true
  hasClose: true, // show close button, optional, default: false

  // iOS only, optional
  album: track.albumName, // optional, default: ''
  duration: this.audio.tracks[this.audio.current].duration, // optional, default: 0
  elapsed: this.audio.tracks[this.audio.current].progress, // optional, default: 0

  // Android only, optional
  // text displayed in the status bar when the notification (and the ticker) are updated
  ticker: 'Now playing ' + track.name
});





this.musicControls.subscribe().subscribe(action => {

  switch (action) {
    case 'music-controls-next':
      this.next();
      break;
    case 'music-controls-previous':
      this.prev();
      break;
    case 'music-controls-pause':
      this.pause();
      this.musicControls.updateIsPlaying(false);
      this.musicControls.updateDismissable(true);
      break;
    case 'music-controls-play':
      this.audio.play(0);
      this.musicControls.updateIsPlaying(true);
      this.musicControls.updateDismissable(true);

      break;
    case 'music-controls-destroy':
      this.musicControls.destroy();
      this.stop();
      break;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants