Is it possible to use the javascript
Player() api to play a sound file (mp3) in the background just like the background audio element
<background>
<audio>
<asset src="<URL>" />
</audio>
</background>
I am trying to use a catalog template for all the video assets in a show and want to play the show theme music lightly in the background. My challenge is that when the user clicks on a tile for a video I push a new view with all the video information and the background audio element stops since a new view was pushed.
My thought was to use the player api, call the music file on the initial view and can stop the player and load the video element when they finally hit the play button on the asset viewer page.
The example below works to play audio elements but when the play command is called it takes over the view and I don't see anywhere in the docs where you can call a player with audio assets to play in the background.
var player = new Player();
var playlist = new Playlist();
var mediaItem = new MediaItem("audio","<URL>");
player.playlist = playlist;
player.playlist.push(mediaItem);
player.play();
Thoughts?