HTML5 Audio Playlist
How do I make an html5 audio playlist?
What is a html5 audio playlist? How do you make a html5 audio playlist? This script and codes were developed by Wyk Parish on 26 November 2022, Saturday.
HTML5 Audio Playlist - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>HTML5 Audio Playlist</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="audioPanel"> <ul id="playlist"> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">1. Introduction</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">2. Rinpoche</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">3. Paloma</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">4. Rinpoche</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">5. Paloma</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">6. Rinpoche</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">7. Paloma</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">8. Rinpoche</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">9. Paloma</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">10. Rinpoche</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">11. Paloma</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">12. Rinpoche</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">13. Paloma</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">14. Rinpoche</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">15. Paloma</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">16. Rinpoche</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">17. Paloma</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">18. Rinpoche</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">19. Paloma</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">20. Rinpoche</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">21. Paloma</li> <li data-mp3="https://docs.google.com/uc?export=download&id=0B2cLBXvhN6QUcVhLcjNsYnJ5b3M">22. Paloma & Rinpoche</li> </ul>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
HTML5 Audio Playlist - Script Codes CSS Codes
body { background-color: #1E508B;
}
audio
{
-webkit-transition:all 0.2s linear;
-moz-transition:all 0.2s linear;
-o-transition:all 0.2s linear;
transition:all 0.2s linear;
-moz-box-shadow: 2px 2px 4px 0px rgba(0,0, 0, 0.4);
-webkit-box-shadow: 2px 2px 4px 0px rgba(0,0, 0, 0.4);
box-shadow: 2px 2px 4px 0px rgba(0,0, 0, 0.4);
-moz-border-radius:7px 7px 7px 7px ;
-webkit-border-radius:7px 7px 7px 7px ;
border-radius:7px 7px 7px 7px ;
}
audio:hover, audio:focus, audio:active
{
-webkit-box-shadow: 15px 15px 20px rgba(0,0, 0, 0.4);
-moz-box-shadow: 15px 15px 20px rgba(0,0, 0, 0.4);
box-shadow: 15px 15px 20px rgba(0,0, 0, 0.4);
-webkit-transform: scale(1.07);
-moz-transform: scale(1.07);
transform: scale(1.07);
}
.playerWrap { display: block; margin: 7px 0 0 0;
}
#audioPanel { width: 400px; padding: 15px; background-color: #dddddd;
}
#audioPanel ul { /* max-width: 660px; for below IE7 use `width: 660px;` */ width: 340px; margin: 0 auto; padding: 0; list-style-type: none;
}
#audioPanel li { -moz-box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.2); -webkit-box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.2); box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.2); background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #eae0c2), color-stop(1, #ccc2a6)); background:-moz-linear-gradient(top, #eae0c2 5%, #ccc2a6 100%); background:-webkit-linear-gradient(top, #eae0c2 5%, #ccc2a6 100%); background:-o-linear-gradient(top, #eae0c2 5%, #ccc2a6 100%); background:-ms-linear-gradient(top, #eae0c2 5%, #ccc2a6 100%); background:linear-gradient(to bottom, #eeeeee 5%, #ccbbaa 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eae0c2', endColorstr='#ccc2a6',GradientType=0); background-color:#eeeeee; -moz-border-radius:18px; -webkit-border-radius:18px; border-radius:18px; border:1px solid rgba(0,0,0,0.2); display:block; cursor:pointer; color:#505739; font-family:Arial; font-size:14px; font-weight:bold; padding: 4px 16px; margin: 3px; text-decoration:none; text-shadow:0px 1px 0px #ffffff;
}
#audioPanel li:hover, .selected { background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ccc2a6), color-stop(1, #eae0c2)); background:-moz-linear-gradient(top, #ccc2a6 5%, #eae0c2 100%); background:-webkit-linear-gradient(top, #ccc2a6 5%, #eae0c2 100%); background:-o-linear-gradient(top, #ccc2a6 5%, #eae0c2 100%); background:-ms-linear-gradient(top, #ccc2a6 5%, #eae0c2 100%); background:linear-gradient(to bottom, #ccc2a6 5%, #eae0c2 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ccc2a6', endColorstr='#eae0c2',GradientType=0); background-color:#ccc2a6;
}
#audioPanel li:active { position:relative; top:1px;
}
HTML5 Audio Playlist - Script Codes JS Codes
// globals
var _player = document.createElement("audio"), _playerWrap = document.createElement("span"), _playlist = document.getElementById("playlist"); //_stop = document.getElementById("stop");
_player.id = "player";
_player.setAttribute("controls","");
_playerWrap.appendChild(_player);
_playerWrap.className = "playerWrap";
// functions
function nextElemSibling( el ) { do { el = el.nextSibling } while ( el && el.nodeType !== 1 ); return el;
}
function playlistItemClick(clickedElement) { var selected = _playlist.querySelector(".selected"); if (selected) { selected.classList.remove("selected"); } clickedElement.classList.add("selected"); clickedElement.appendChild(_playerWrap); _player.src = clickedElement.getAttribute("data-mp3"); _player.play();
}
function playNext() { var selected = _playlist.querySelector("li.selected"); if (selected && nextElemSibling(selected)) { playlistItemClick(nextElemSibling(selected)); } else { selected.classList.remove("selected"); selected.removeChild(_playerWrap); }
}
// event listeners
//_stop.addEventListener("click", function() {
// _player.pause();
//});
_player.addEventListener("ended", playNext);
_playlist.addEventListener("click", function(e) { if (e.target && e.target.nodeName === "LI") { playlistItemClick(e.target); }
});
Developer | Wyk Parish |
Username | wykananda |
Uploaded | November 26, 2022 |
Rating | 3 |
Size | 2,979 Kb |
Views | 22,264 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Bodhicitta | 1,693 Kb |
KR Top | 4,270 Kb |
HTML5 Audio Playlist Long | 4,332 Kb |
SASS | 1,558 Kb |
ClipboardJS | 3,331 Kb |
KC FlexiFrame | 1,889 Kb |
MediaElement Player | 2,414 Kb |
Select2 multiselect test | 2,209 Kb |
Responsive Fancy Border-Image | 2,117 Kb |
Amplitude Test | 1,957 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Responsive Menu I | Rodericksandoval | 3,045 Kb |
Board Site | IndianaLuft | 10,542 Kb |
NT Tribute | Skybutterfly | 2,850 Kb |
Rows with image hover effect | Amit-webdesigner | 12,875 Kb |
IbrahimJabbari-Effect14 | Ibrahimjabbari | 1,919 Kb |
Shop Talk logo made in CSS | Hugo | 19,368 Kb |
A Pen by Rob Levin | Roblevin | 2,787 Kb |
React Vote Component | Souporserious | 5,465 Kb |
Flat UI Button | Honchoman | 2,289 Kb |
A Pen by Eka Risyana | Risyana | 3,705 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!