Custom Built Audio Player 🎵

Today I have a more in advanced Custom Interaction experiment to share with you. I’ll be building this sleek glass audio player that has an expandable track listing. When the tracks are clicked they will be loaded and automatically begin playing.

:anchor: Element IDs

All of the core parts of the audio player interface have ID’s assigned that will be used in the custom interactions.

• Artwork thumbnail = #player-artwork
• Play button = #play-btn
• Pause button = #pause-btn
• Playing track title = #play-title
• Playing track artist = #play-artist
• Expand playlist button = #expand-btn
• Playlist = #playlist
• Each Track item in list = #track-1, #track-2, #track-3
• Audio Player Bric = #player

:arrow_forward: Play Interaction
When the play button (#play-btn) is clicked it will trigger the Play Interaction.

The Play Interaction contains 3 rules.

:pause_button: Pause Interaction
When the pause button (#pause-btn) is clicked it will trigger the Pause Interaction.

The Pause Interaction also contains 3 rules.

:eye: Toggle Playlist
When the expand playlist button (#expand-btn) is clicked it will trigger the Toggle Playlist Interaction.

The Toggle Playlist Interaction contains 2 rules.

:truck: Load Track
The Load Track Interaction is assigned to each track list item (#track-1, #track-2, #track-3) in the play list (#playlist) so that it is triggered when the item is clicked. Each track list item has 5 custom data attributes assigned that will be used within the Load Track Interaction with the help of the data() short code. The value of these data attributes is unique for each track list item.

The Load Track Interaction has 7 rules. Five of these rules use the data attributes assigned to the relevant list item which will trigger the interaction.

:white_check_mark: Always Export
Only one of the mp3 audio files is used on the page in the Audio Player Bric (#player), this means we need to ensure all used audio files are set to Always Export in the Asset Manager. (requires Blocs for Mac 6.1.3).

:beers: Mission Complete
That’s it, all of the logic for the audio player is now set up. I appreciate this is a more complex use case for Custom Interactions but it demonstrates what is possible without using code :zap:.


:point_down: Download Example Project :point_down:

Glass Audio Player Experiment - :warning: Requires Blocs v6.1.3 minimum


:interrobang: Norm, you didn’t explain how to create the sleek glass styling?
Make yourself a nice cup of coffee / tea, open the example project :point_up_2: and take a look at the classes :face_with_monocle:. The glass effect is created with a subtle mix of background Blur filters, semi-transparent fills and box shadows.

11 Likes

My man.
You made it.
Fantastic.

2 Likes

Absolute :fire:

:fire_extinguisher: :fire_engine:

2 Likes

This is brilliant !!!.. @Norm is on fire !!!..that Switch 2 will be well deserved when it arrives ! :joy:

2 Likes

Looks great! :+1:

Now, we need an easy way to package custom blocks with custom interactions. I’m sure there will be a new category in the Minimalist Library just for such things, “Easily reusable with just a one-click”!

5 Likes

This is golden. Thank you @Norm

2 Likes

Absolutely.

It’s still early days but with each Custom Interaction experiment that I create, I find shortcomings that I note down and improve with each Blocs release.

The end goal is to make these as easy as possible to make and share with others, so they can just drop them into their websites.

7 Likes

If I could get my hands on one! Maybe next year at this rate :sweat_smile:

1 Like

You might need a new store category :stuck_out_tongue:

3 Likes

Wow looks like Custom Interactions are really turning heads! :scream:

After linking to this forum post in our last newsletter, we’ve had a lot of upgraders and brand new Blocs 6 users join us. :wave:

I will have to use glass in more examples!

#NoCode #BlocsRocks :boom::fist_left:

5 Likes

Yeah - seeing that short clip of the Audio player would really push users as it is a really great design.

Even though the users here can see and know from the images - nothing sells better than a video clip of it being run.

Even better @Norm would be a link to the player on a LIVE website showcasing it be even better !!?? I have been thinking the below since your videos started on them, it would be a great experience.

Stage 1: Norm telling us what Custom Interactions do! - Nearly all regulars upgrade.
Stage 2: Norm doing videos on how Custom Interactions work step by step! - More upgrade and we learn how to adapt for out own use
Stage 3: Norm doing short examples and introducing glass finish in his design - more upgraders and more new users!!
Stage 4: Custom Interactions LIVE site with all the interactions created for users to be amazed and new users to see what is possible ! - this would show a link to the videos showing how they are made or the forum link - will increase users, knowledge, sales.

People love to see and click!

6 Likes

Yeah I’ve been thinking about this, a live site with examples and download links etc. :thinking:

6 Likes

Good idea! I also have plans for something similar to do this year. Custom Interactions are turning out to be even more powerful than I thought! :clap:

3 Likes