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

Add function for seeking time in iOS control center and lockscreen #71

Merged
merged 1 commit into from
Jun 27, 2017

Conversation

BuddyLReno
Copy link

@BuddyLReno BuddyLReno commented Jun 23, 2017

This commit adds support for scrubbing with the progress bar on iOS' control center and lockscreen. This fixes #60 and #61.

Ionic Native PR: danielsogl/awesome-cordova-plugins#1727

  • New event: music-controls-seek-to
  • New function: MusicControls.updateElapsed(args: object);

THIS IS A BREAKING CHANGE (probably needs to update to 2.0.0 with this)

  • Change: messages are now returned as json and need to be parsed.
    JSON.parse(action) === { message: "music-controls-next" }

This is due to the fact that we need to get the new position of the audio file after the user has scrubbed with the iOS scrubber. Seconds are returned by iOS:

JSON.parse(action) === { message: "music-controls-seek-to", position: "208" }
The position param returned by the music-controls-seek-to event is in seconds.

@homerours
Copy link
Owner

Thank you @BuddyLReno ! It looks good :) (However, I have no iOS device to test it...)
The Json messaging system was a needed evolution, everything is fine.

@homerours homerours merged commit 391aab3 into homerours:master Jun 27, 2017
@BuddyLReno
Copy link
Author

No problem @homerours! I've been using the new function with success in my company's iOS app streaming mp3's from libsyn. Should the version number be bumped? If someone updates to this version of the plugin, their implementation will break.

@BuddyLReno
Copy link
Author

Also haven't heard from Ionic about the ionic native PR I placed at the same time to add this function.

@homerours
Copy link
Owner

Ok great! I going to update the version number. And if in the future you would like to add some more updates, I can grant you the "writing rights" on this project.

@BuddyLReno
Copy link
Author

@homerours Totally! I'd love to continue to contribute. 👍

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

Successfully merging this pull request may close these issues.

iOS: notifications/lock-screen time elapsed issue
2 participants