TransWikia.com

How can I show a playback progress bar in WatchKit NowPlaying view

Stack Overflow Asked by AlexW.H.B. on February 13, 2021

I have gotten some of the NowPlaying view text elements to work using this:

func updateInfoState(){
    let artwork = MPMediaItemArtwork.init(boundsSize: self.uiImage.size, requestHandler: { (size) -> UIImage in
        return self.uiImage
    })
    MPNowPlayingInfoCenter.default().nowPlayingInfo = [MPMediaItemPropertyAlbumTitle: title,
                              MPMediaItemPropertyArtist: author,
                              MPMediaItemPropertyTitle: trackName,
                              MPMediaItemPropertyArtwork:artwork,
                              MPNowPlayingInfoPropertyElapsedPlaybackTime: 0.0,
                              MPNowPlayingInfoPropertyPlaybackRate: 1.0,
                              MPNowPlayingInfoPropertyIsLiveStream: false,
    ]
  }

But I’m unable to get the playback position to update. I was trying MPNowPlayingInfoPropertyElapsedPlaybackTime and MPNowPlayingInfoPropertyPlaybackRate, but they literally did nothing. Any help would be greatly appreciated.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP