shi11 / RemoteControls

cordova 3 plugin for interacting with ios7 remote controls and metadata
57 stars 41 forks source link

play/pause resets song info #6

Closed tomaszrondio closed 8 years ago

tomaszrondio commented 9 years ago

When I click play or pause button on locked screen it stops/starts playing but also resets song information. Also home button removes both controls and song info.

BTW: I had to import remoteControls.h in MainViewController to make it work.

shi11 commented 9 years ago

Thnx Tomasz!

tomaszrondio commented 9 years ago

It happens because js Audio element stops playing and it "overwrites" RemoteControls song info. Workaround is to updateMetas again using timeout.

greatwitenorth commented 9 years ago

@tomaszrondio I had the same issue. Just did the updateMetas on pause events. It's too bad though cause the URL still flashes for a moment when using the >> button to skip a song. Is there any way around this?

tomaszrondio commented 9 years ago

It also flashes in my app. I haven't found good solution for that.

pvandrunen commented 9 years ago

I set the metadata to update on the play/pause listeners but here again I have the temporary flash of the file URL, it doesn't, however, flash when I hit the next/previous buttons.

greatwitenorth commented 9 years ago

@pvandrunen I'm seeing the same thing. The only way around it so far is to implement audio natively. The only library out there that has this is PlayerHater but in my experience it's very buggy and not currently compiling properly on iOS or Android.

pvandrunen commented 9 years ago

Thanks @greatwitenorth, I will live with the temporary flash when pausing/playing over compile issues and bugs.

pvandrunen commented 9 years ago

I noticed on YouTube that the slide-up controls in iOS display the title attribute in the

LukePulverenti commented 9 years ago

Just to confirm - you guys are using a plain html audio element?

pvandrunen commented 9 years ago

We are using a custom built js audio player, like this: this.myaudio = new Audio(myaudioURL);

greatwitenorth commented 9 years ago

I have a similar setup to @pvandrunen

LukePulverenti commented 9 years ago

Right, you have a custom api, but what is your underlying playback method? html audio tag? WebAudio? a native player?

greatwitenorth commented 9 years ago

I'm using an HTML audio tag.