Media Player & Song Library

I’ve been tinkering with this Media Player & Song Library for a while. It utilizes audio player embeds with autoplay enabled to create playlists. I have to share it now or else I’ll keep tinkering forever. Enjoy!

(This uses max horizontal space, so it’s best to open and use.)

It’s not perfect. I’d love to know if someone has a better approach for the up and down arrows in the “playlist” table. Gathering and inputing links is cumbersome compared to using iTunes or Spotify. But I’ve found after using this doc, it’s nice to have a repository of free music from different sites that can also play the links. Thanks for checking it out!

11 Likes

Dear @Phil_Hamilton-Schmidt,

Another masterpiece :diamond_shape_with_a_dot_inside:, thanks sharing your great work, showing the potential of of Coda.
We have now the chance to upload our mood " :eye: & :musical_score: " and getting even more inspired.

Thanks sharing your great work :handshake:

Nice!

I once wanted to make a Coda piano (with a video like this) but for some reason it wouldn’t autoplay for me.

Thanks @Jean_Pierre_Traets and @Paul_Danyliuk!

I love the piano idea. I think you could pull it off! I found that youtube wouldn’t autoplay with only “?autoplay=1” at the end of the embed URL. It needs to be accompanied by any other parameter in order to work. I added “&start=0” to all videos unless the link includes its own start value. Here’s how my table ultimately outputs the youtube embeds:

Input URL:
https://youtu.be/9TYf_qrw2WQ

Final Embed Formula
Embed("https://www.youtube.com/embed/9TYf_qrw2WQ?autoplay=1&start=0", height , width, force: true)

Looking at the list of YouTube parameters, it would be really cool to use the “setVolume()” parameter to achieve dynamics in a Coda piano. I would love to see one!

This is amazing! Thank you for sharing - it’s incredible to see how far you’re pushing the product.

2 Likes

Super creative @Phil_Hamilton-Schmidt! One of the most colorful docs I’ve seen :rainbow:

2 Likes

Tried your tips, doesn’t work reliably. Sometimes it would autoplay, sometimes it wouldn’t. I guess that’s because the video is essentially the same, and YouTube has some logic within that would prevent autoplay on too many requests.

Aw man. That’s too bad!

Also @Phil_Hamilton-Schmidt how do you update the progress bar while the song is playing? Are you starting the 2-button loop somewhere? I cannot find it anywhere in the doc.

I was wondering how you managed to set up auto-advancing the playlist. Because I recently found the _Delay() function, and was wondering whether maybe you had found it before me.

Hey Paul – I hadn’t discovered the delay function. And there’s no 2-button loop in this doc. It’s been a while (and I’m a little rusty), but let me see if I can remember. I think it’ll be easier to start with the auto-advance question…

The auto-advance works like this… When you press Start button in the Media Player, it sets the Media Player Control Start Time. The Playlist table then gives each song its own Start and Stop Times which are sums of the Media Player Control Start Time and song durations. The Playlist table determines which song is Currently Playing based on which song’s Start Time <= Now and Stop Time > Now. The Media Player embeds the song from the playlist where Currently Playing is true. So as long as the Media Player Control Start Time doesn’t change, the playlist will advance as Now coincides with a songs’ Start and Stop times.

The progress bar uses the songs Start and Stop times and their relation to Now. Elapsed time is Now - Start Time. And time leftover is Stop Time - Now.

Hope that makes sense!

1 Like

Oh yeah, totally. Forgot that formula could replace the iframe simply based on now() <> value in table. Thanks.