Search This Blog

html5-music player - Embed an audio file to three different audio players on your HTML5 page with controls HackerRank hands-on Fresco Play

 Embed an audio file to three different audio players on your HTML5 page with controls and implements the following characteristics respectively:     

  • regular player
  • Preload the audio(browser should NOT load the audio file when the page loads)
  • Run the  audio in a loop
Steps to do hands-on:
  1. install the required packages by clicking the install button
  2. write the code
  3. run the application and test it

Answer:

<!DOCTYPE html>
<html>
<head>
  <link rel="icon" href="favicon.png" type="image/png">
  <title>Destiny</title>
  <link href="mystyle.css" rel="stylesheet" type="text/css">
</head>
<body>
 // write your code
 <p>
 <audio controls>
  <source src="SampleAudio.mp3" type="audio/mpeg">
</audio>
 <audio controls="" preload='none'>
  <source src="SampleAudio.mp3" type="audio/mpeg">
</audio>
 <audio controls="" loop=''>
  <source src="SampleAudio.mp3" type="audio/mpeg">
</audio>
 </p>
</body>
</html>


Click on test image:










No comments:

Post a Comment

If you have any doubts, Please let us know.