Audio Player
Table of Contents
Audio player
The Pugpig audio player features several components that your users can take advantage off to listen to audio content via your app.
Context menu
When audio content in the app is interacted with, either in the timeline or in an article, a menu is brought up showing info about the track with the option to:
- Play the track
- Add a track to your queue (either the beginning or the end)
- View the queue which will open the audio player
Audio playlists
We also provide an additional option for playing all audio in a collection, especially useful for editions with audio versions of articles. To enable this you can either manually insert header cards into your timeline or edition and select the relevant ‘Show audio button’ setting:
- Hide (Standard header card with no audio)
- Play all (all tracks in the collection)
- Play tracks until next header
Or we can adjust your editions to automatically include them. If enabled this will show header cards for titles and sections within your editions. The title card will play all audio in an edition if tapped, while the header card will play all audio in a section if tapped. Note that this can be controlled per edition if desired, via edition options
The player
The player itself shows:
- The currently playing track
- Your queue of upcoming tracks with the option to; download all or some of them for offline listening or to reorder or clear the queue
- Your track history, which is shown above the queue if you scroll
- Audio controls to; download, go back to the start, rewind, play/pause, control playback speed, fast forward, go to next track
If you then continue to browse the app an unobtrusive miniplayer will show at the bottom of the screen which shows basic info about the track as well as progress and the functions to play/pause, quickly rewind or tap to access the full player. The player is dismissible, which will also stop audio playing.
If the app is backgrounded or the device is locked, audio will continue to play in the background. This needs to be enabled on iOS when configuring the audio content so please let us know if you would like this functionality. It will require an app update if it is not enabled on submission. On Android it will always play in the background.
Audio player metadata
Note: This section is about what displays in either the in-app Audio Player or the device Audio Player. What displays in the app timeline, on an Audio card, is controlled separately in the CMS.
To retrieve metadata from an audio file we use the ID3 metadata container. ID3 allows information about the file, such as title, artist, image etc, to be stored within the file itself.
The mp3 that’s uploaded to Express, or that we retrieve from an external source, needs to have all the relevant metadata included within the file.
To test what’s in your file before uploading it to Express, open the audio track on your computer. However it displays there in your native device audio player is what will show in the Pugpig audio player.
Below is all of the information we use and will need in the file:
- Track title
- Author
- Description
- Image
- Track duration (read automatically from the file)
We can also store the Album, Genre and Caption, but by default these aren’t displayed anywhere for a user to see.
If a track has been uploaded without any or some metadata attached, it can be added in the media library, however we’re unable to overwrite metadata that already exists in the file (even if you attempt to replace it in the Express media library) because we still read it from the file.
CarPlay and Android Auto
Pugpig Bolt can support streaming from the app via CarPlay (and via Bluetooth). This allows users to access the native player control from the dashboard screen - i.e. play, pause, skip track. We believe the same is true of Android Auto due to the way we’ve integrated the device player and all associated APIs, but our product team are currently confirming this.
Our current functionality does not not extend to creating standalone CarPlay or Android Auto apps, but this may change in the future.