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 the option to update trackMetadata #331

Merged
merged 10 commits into from
Apr 14, 2019

Conversation

HybridFox
Copy link
Contributor

Works for android & iOS. Handy for icecast / shoutcast / etc... audio streams.

#194 #93 #192

@Guichaguri Guichaguri requested a review from dcvz November 2, 2018 14:26
Guichaguri
Guichaguri previously approved these changes Nov 2, 2018
Copy link
Collaborator

@Guichaguri Guichaguri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leonhh
Copy link

leonhh commented Nov 20, 2018

Any chance this can get merged soon? Looks like a useful addition.

@HybridFox
Copy link
Contributor Author

Is there a possibility for an update on this?

@Guichaguri
Copy link
Collaborator

I'm waiting for a review on the iOS part from @dcvz, once he gives a green light, we can merge it.

Copy link
Contributor

@dcvz dcvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one comment, otherwise looks good 👍

func updateMetadata(_ item: Track) {
MPNowPlayingInfoCenter.default().ap_update(
with: item,
duration: 100,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have track duration from the item, right? perhaps even progression can be inferred here.

@Guichaguri
Copy link
Collaborator

You're dynamically sending metadata updates, don't you think it would be better if you updated the current track object instead?

I was thinking about something like updateTrack(id, obj), which allows you to update only metadata-related properties. That way, it not only allows you to update metadata from other tracks in the queue, but also keeps the metadata changes through any playback updates.

For instance, if you have used updateMetadata and the track is stopped and started again, you'll have to use updateMetadata again. The same can happen with any other playback update.

Copy link
Contributor

@dcvz dcvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this @HybridFox and sorry for the delay! <3

@dcvz dcvz merged commit 493faee into doublesymmetry:dev Apr 14, 2019
dcvz added a commit that referenced this pull request Apr 14, 2019
dcvz added a commit that referenced this pull request Apr 14, 2019
dcvz added a commit that referenced this pull request Apr 14, 2019
dcvz added a commit that referenced this pull request Apr 14, 2019
dcvz added a commit that referenced this pull request Apr 14, 2019
dcvz added a commit that referenced this pull request Apr 14, 2019
Guichaguri added a commit that referenced this pull request Apr 14, 2019
This PR adds the `updateMetadataForTrack(id, metadata)` function which allows you to update any track in the queue, including the current one. It returns a promise which resolves after the metadata has been successfully updated.

Closes #93 and supersedes #331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants