update mpmedia value on seek
This commit is contained in:
@@ -98,15 +98,17 @@ func NewMPMediaHandler(player *player.Player, playbackManager *PlaybackManager)
|
||||
C.set_os_playback_state_stopped()
|
||||
})
|
||||
|
||||
mp.player.OnSeek(func() {
|
||||
C.update_os_now_playing_info_position(C.double(mp.player.GetStatus().TimePos))
|
||||
})
|
||||
|
||||
mp.player.OnPlaying(func() {
|
||||
C.set_os_playback_state_playing()
|
||||
C.update_os_now_playing_info_position(C.double(mp.player.GetStatus().TimePos))
|
||||
})
|
||||
|
||||
mp.player.OnPaused(func() {
|
||||
C.set_os_playback_state_paused()
|
||||
})
|
||||
|
||||
mp.player.OnSeek(func() {
|
||||
C.update_os_now_playing_info_position(C.double(mp.player.GetStatus().TimePos))
|
||||
})
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ void set_os_now_playing_info(const char *title, const char *artist, const char *
|
||||
MPMediaItemPropertyTitle: [NSString stringWithUTF8String:title],
|
||||
MPMediaItemPropertyArtist: [NSString stringWithUTF8String:artist],
|
||||
MPMediaItemPropertyArtwork: coverArt,
|
||||
MPNowPlayingInfoPropertyElapsedPlaybackTime: @(0),
|
||||
MPMediaItemPropertyPlaybackDuration: @(trackDuration) // Expects 'NSNumber'
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user