Skip to content

Android Auto: General podcast improvements

Description

This MR contains a few updates which streamline podcast playback under Android Auto

  • When podcasts are interrupted by GPS instructions, text messages, etc. they are paused instead of volume being lowered by 1/3 (ducking)
  • Playback resumes after a two second delay, with a five second seek back in time. Time is currently non-configurable, but seems correct when listening to audio books
  • Podcast playback progress is shown in the Android Auto menu while browsing and updated live during playback. Refer to Build media apps for cars
  • Seek from Android Auto now correctly updates the internal progress. This is required for the changes above to keep the media session in sync with VLC's time. This also corrects a longstanding issue with seeking in the notification bar while paused. Previously, if you paused, jumped forward, and then hit play, the time would jump back. With this update the timeline is fully synced to playback.

Motivation and Context

Feature request #2927 (closed) combined with a number of small improvements.

Google's API design requires the mediaId match the mediaId value from the playback session and metadata classes in order to synchronize the progress bar. I would have preferred if they had used a new extra (or the URI) for this purpose, as the mediaId is the only means to support menu navigation. Due to the dual use as both a primary key identifier and navigation path, VLC's mediaId is not always the absolute identifier for a track such as //org.videolan.vlc/r/media/1234. The value could be //org.videolan.vlc/r/album/34?i=4 to indicate we are queuing all of album 34 and starting playback at track 5 (which happens to be media id 1234). Thankfully, Android Auto also passes the extras bundle to the media session callback, so we are able to swap the media id and set it to a unique identifier while still retaining play from here behavior by passing the original mediaId in the extras bundle.

The rootHint EXTRA_BROWSER_ICON_SIZE is used as a sentinel to detect Android Auto in order to support the behavior discussed above. Although the Driving Mode interface does not support showing a progress indicator, we cannot treat both identically because it does not pass the extras bundle when invoking onPlayFromMediaId.

How Has This Been Tested?

Tested on a Pixel 3 running Android 11

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which cleans up / improves existing functionality)

Checklist

  • I have read the CONTRIBUTING section of the README document.

Resolves

Fixes: #2927 (closed)

Edited by Robert Stone

Merge request reports

Loading