Added switching between items in playlist display.

This commit is contained in:
2022-04-19 17:47:14 -05:00
parent 9a940ea55d
commit d0d6f87f34
2 changed files with 18 additions and 3 deletions

View File

@@ -20,6 +20,12 @@
const playlist = previousPlaylist; // We are assuming you have a playlist ready.
const player = new ask.player.MusicPlayer(playlist) // Creates a new music player with the playlist.
</code></pre>
<p>We'll also show the playlist display so you can see how it updates corresponding to the music currently selected.</p>
<div class="result">
<div id="playlist-display">
</div>
</div>
</div>
<div>
<h2>Display a Play Button</h2>
@@ -66,6 +72,9 @@
playlist.add("./assets/audio/moments.mp3", "Moments", "Lost Identities x Robbie Rosen");
playlist.add("./assets/audio/XXI.mp3", "XXI", "QR");
const playlistDispElement = playlist.generatePlaylistElement();
document.getElementById("playlist-display").append(playlistDispElement);
const player = new ask.player.MusicPlayer(playlist);
const playElem = player.generatePlayElement();
document.getElementById("musicplayer-playbtn-demo").appendChild(playElem);