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

Pause button always active on lock screen #18

Open
nigel-dev opened this issue Aug 25, 2015 · 2 comments
Open

Pause button always active on lock screen #18

nigel-dev opened this issue Aug 25, 2015 · 2 comments

Comments

@nigel-dev
Copy link

Using the plugin I am able to get all the play/pause/next/prev functionality on the lock screen and the control center. The issue that I am running into is that on the lock screen it always shows the pause button no mater if it is playing or not.

I am using @ghenry22 media plugin fork (https://github.com/ghenry22/cordova-plugin-media) for the ability to use the AVPlayer to stream mp3's

@DahliaWitt
Copy link

Getting the same issue, any way of fixing it?

@sinedied
Copy link

The plugin is flawed on this, as it always reports the audio as playing.

My quick fix was to add an extra boolean parameter, to tell if audio is playing or not:

- (void)updateMetas:(CDVInvokedUrlCommand*)command
{
   ...
    NSNumber *isPlaying = [command.arguments objectAtIndex:6];
    ...

                    MPNowPlayingInfoCenter *center = [MPNowPlayingInfoCenter defaultCenter];
                    center.nowPlayingInfo = [NSDictionary dictionaryWithObjectsAndKeys:
                        artist, MPMediaItemPropertyArtist,
                        title, MPMediaItemPropertyTitle,
                        album, MPMediaItemPropertyAlbumTitle,
                        artwork, MPMediaItemPropertyArtwork,
                        duration, MPMediaItemPropertyPlaybackDuration,
                        elapsed, MPNowPlayingInfoPropertyElapsedPlaybackTime,
                        isPlaying, MPNowPlayingInfoPropertyPlaybackRate, nil];
                }
            });

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

3 participants