You are on page 1of 1

Creating an MP3 Player with HTML5

Lab Exercise 1

1) The API for video is identical to that of Audio in HTML5 and
Javascript.  Switch out the audio element in the rudimentary player
you produced in this chapter with a video element.  You can still use
the ‘controls’ attribute and the source elements as demonstrated in
the video lecture.  It is recommended that if you use the video
element you need to use height and width as attributes of the video
tag­­ or set the height and width using CSS.

Find some video content and use that as the source. You can convert
the format of your video clip online if needed.

Test your video player and all of the features.

2) Instead of using the standard HTML buttons rendered by the
browser, create more attractive buttons by using a site like this:
http://css3button.net/.  Once you render the buttons in the site,
copy and integrate the code into your player to make the buttons more
attractive.

3) Alter the timer so that instead of counting from 0:00 and showing
seconds elapsed, make it show time remaining in the media clip.
(You’ll have to do a little fancy Javascript math for this­­ but it
can be done!)

__________________

1) Please like LearnToProgram on Facebook­­ www.facebook.com/learntoprogram.tv
2) Sign up for our email list at www.learntoprogram.tv/register.  We periodically send
more free learning material and steep discounts on our premium courses.

You might also like