Media Player

We're going to build a media player to let the user control playing a song.


Play this demo in full screen.

1) Choose a song and make it play as the project loads.


Play this demo in full screen.

2) Add a sprite to be a pause button, and make it pause the sound when you click it.


Play this demo in full screen.

3) Add a sprite to be a play button, and make it play the sound when you click it.


Play this demo in full screen.

4) Add a sprite to be a stop button, and make it stop the sound when you click it. (Stop will reset the sound back to the beginning when you play it next)


Play this demo in full screen.

5) Bonus: Add a display for the user to see if the sound is currently paused.


Play this demo in full screen.

6) Add text that displays the volume of the sound.


Play this demo in full screen.

7) Add a way to adjust the volume of the sound. This could be sprites to click that adjust the volume up/down, choosing keys that will adjust the volume, or (as a challenge) a slider that can be clicked and/or dragged to adjust the volume.


Play this demo in full screen.

8) Display and allow adjustment of the current time of your sound, similar to the volume.


Play this demo in full screen.

9) Challenge: Can you allow the user to swap between different sounds? How much code can be shared between different sounds?


Play this demo in full screen.