Minimal HTML5 Audio Player with JavaScript

Essential Audio Player JS is a simple, clean, reduced-to-the-essential JavaScript / HTML5 / CSS web audio player.

Essential Audio Player JS is a simple, clean, minimal, reduced-to-the-essential JavaScript / HTML5 / CSS web audio player. No unnecessary controls, just a button and a track (which is optional).

Pure JavaScript, no framework dependency.
Pure HTML5, based on the <audio> tag.
Super easy to embed.
CSS customizable.
Fully mobile. Fully responsive.
Free for everyone!

View demo and get more info:
https://essential.audio

Essential Audio Player JS is a simple, clean, reduced-to-the-essential JavaScript / HTML5 / CSS web audio player.

Download Details:

Author: Freeedle

Demo: https://essential.audio/

Source Code: https://github.com/Freeedle/Essential-Audio-Player

#javascript #html5

What is GEEK

Buddha Community

Minimal HTML5 Audio Player with JavaScript

Minimal HTML5 Audio Player with JavaScript

Essential Audio Player JS is a simple, clean, reduced-to-the-essential JavaScript / HTML5 / CSS web audio player.

Essential Audio Player JS is a simple, clean, minimal, reduced-to-the-essential JavaScript / HTML5 / CSS web audio player. No unnecessary controls, just a button and a track (which is optional).

Pure JavaScript, no framework dependency.
Pure HTML5, based on the <audio> tag.
Super easy to embed.
CSS customizable.
Fully mobile. Fully responsive.
Free for everyone!

View demo and get more info:
https://essential.audio

Essential Audio Player JS is a simple, clean, reduced-to-the-essential JavaScript / HTML5 / CSS web audio player.

Download Details:

Author: Freeedle

Demo: https://essential.audio/

Source Code: https://github.com/Freeedle/Essential-Audio-Player

#javascript #html5

How to create a Simple JavaScript Audio Player

JavaScript Audio Player is a popular client-side project. This type of Simple JavaScript Audio Player is used when using audio in projects or websites. Music player is made in many advanced ways using different types of programming code.

From this tutorial, you will learn how to create a Simple Audio Player using HTML 5 and javascript. There are many tutorials on the Internet for creating HTML audio players

However, I noticed that a lot of advanced JavaScript has been used to create that design. I have created this music player tutorial to solve that problem.

Simple Javascript Audio Player

You will find many tutorials on creating a simple audio player on the Internet. However, in most cases, a lot of difficult JavaScript has been used. However, in this case, I have used very simple JavaScript and no external library is used here.

Ordinary music players have many options. Image, song change options, playlists, etc. make the audio player interesting. Live Preview 👇

Hopefully from the demo above you have learned how to create an HTML Audio Player. With this music player HTML code you can copy from the demo section.

Since this is a simple design, there are not many options. Only one audio has been used here. It also has some control buttons that will control the audio. It also has a sound control button in this Simple JavaScript Audio Player.

How to Create an Audio Player in JavaScript

Now I am going to see step-by-step how to create this project (music player HTML CSS javascript). Here I have used HTML, CSS, and javascript.

Step 1: Basic structure of Audio Player

A box has been created at the top of the web page using the following HTML and CSS. This box will serve as the basic structure of this audio player.

<div class=”container”>
  <div class=”text-container”>
  </div> 
</div>
* {
  box-sizing: border-box;
}
html {
  background: #084b78;
}
html, body, .container {
  height: 100%;
  margin: 0;
 font-family: Arial, Helvetica, sans-serif;
}
.container {
  display: flex;
  align-items: center;
  justify-content: center;
}
.text-container {
  background-color: rgb(255, 255, 255);
  padding: 40px 50px;
  border-radius: 5px;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}
Basic structure of Audio Player

Step 2: Add a heading in Music Player

Now a heading has been added to this Simple JavaScript Audio Player. This heading is for design only.

<span class=”text”>Audio Play</span>
.text {
  color: #ffffff;
  display: block;
  background-color: green;
  margin: -40px -50px 30px -50px;
  font-size: 25px;
  padding: 3px;
}
Add a heading in Music Player

Step 3: Button to control Audio Player

Now different types of control buttons have been added here. There are basically four buttons to control this js audio player

For a fast forward, for a fast backward, it has play and stops buttons. An on-click function has been added for each button.

<div class=”playback_controls”>
    <button onclick=”skip(‘back’)”><i class=”fa fa-fast-backward”></i></button>
    <button onclick=”playpause()”><i class=”fa fa-play”></i><i class=”fa fa-pause”></i></button>
    <button onclick=”stop()”><i class=”fa fa-stop”></i></button>
    <button onclick=”skip(‘fwd’)”><i class=”fa fa-fast-forward”></i></button>
</div>
.playback_controls{
  box-shadow: 0 0 20px rgba(0,139,253,0.25);
  padding: 20px 40px;
}
button {
  background: #000000;
  color: #ffffff;
  background: linear-gradient(0deg,#000000,#262626);
  font-size: 14px;
  border: none;
  outline: none;
  padding: 0px 15px;
  width: 55px;
  height: 30px;
  line-height: 30px;
  border-radius: 5px;
}
Button to control Audio Player

Different background colors have been added to the four buttons by your own CSS.

button:nth-child(1){
  background: rgb(2, 57, 130);
}
button:nth-child(2){
  background: rgb(172, 4, 4);
}
button:nth-child(3){
  background: rgb(24, 157, 6);
}
button:nth-child(4){
  background: rgb(2, 57, 130);
}
Audio Player for Beginners

Step 4: Audio’s distance control slider

Now it needs to create a range slider that will control the distance of the music. This means that you can determine where you want to listen to the audio with this control button.

<div id=”seekbar”>
   <input type=”range” oninput=”setPos(this.value)” id=”seek” value=”0″ max=””>
</div>
input[type=”range”] {
  border: 1px solid #000000;
  height: 5px;
  max-width: 200px;
  width: 100%;
  vertical-align: middle;
  border-radius: 20px;
  background-color: #232323;
  outline: none;
}
input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 20px;
  border: 4px solid  #035179;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  background: #ffffff;
}
Audio's distance control slider

Step 5: Audio Player’s Sound Control Slider

Now you need to create a volume control button in this Simple JavaScript Audio Player. There are two things to control the volume. 

First, there is a button which is basically to turn on and off the audio in this music player. Then there is a range slider by which the value of volume can be controlled.

<div class=”volume_controls”>
    <button id=”mute” onclick=”mute()”><i class=”fa fa-volume-up”></i></button>
    <input type=”range” id=”volume” oninput=”setVolume(this.value)” min=”0″ max=”1″ step=”0.01″ value=”1″>
</div>
.volume_controls button{
  background: rgb(167, 62, 1);
} 
Audio Player's Sound Control Slider

Step 6: Activate Audio Player with JavaScript

JavaScript will help you to implement this simple audio player. Although js plays the most important role in this design. For this, you must have some idea about JavaScript.

var song = new Audio;
var muted = false;
var vol = 1;
song.type = ‘audio/mpeg’;
// audio url
song.src = ‘https://www.bensound.com/bensound-music/bensound-summer.mp3’; 
function skip(time) {
   if (time == ‘back’) {
      song.currentTime = (song.currentTime – 5);
   } else if (time == ‘fwd’) {
      song.currentTime = (song.currentTime + 5);
   }
}
//pause button
function playpause() {
   if (!song.paused) {
     song.pause();
   } else {
     song.play();
   }
}
//stop button
function stop() {
   song.pause();
   song.currentTime = 0;
   document.getElementById(‘seek’).value = 0;
}
function setPos(pos) {
   song.currentTime = pos;
}
//sound mute button
function mute() {
  if (muted) {
    song.volume = vol;
    muted = false;
    document.getElementById(‘mute’).innerHTML = ‘<i class=”fa fa-volume-up”></i>’;
  } else {
    song.volume = 0;
    muted = true;
    document.getElementById(‘mute’).innerHTML = ‘<i class=”fa fa-volume-off”></i>’;
  }
}
function setVolume(volume) {
   song.volume = volume;
   vol = volume;
}
song.addEventListener(‘timeupdate’,function() {
   curtime = parseInt(song.currentTime,10);
   document.getElementById(‘seek’).max = song.duration;
   document.getElementById(‘seek’).value = curtime;
})
Audio Player with JavaScript

This design is sufficient to use as a free music player on different web pages. Since I designed it to target beginners, I used the simplest code. If there is any problem then you can definitely let me know by commenting.

Original article source at: https://foolishdeveloper.com/

#javascript #audio #player 

Rahul Jangid

1622207074

What is JavaScript - Stackfindover - Blog

Who invented JavaScript, how it works, as we have given information about Programming language in our previous article ( What is PHP ), but today we will talk about what is JavaScript, why JavaScript is used The Answers to all such questions and much other information about JavaScript, you are going to get here today. Hope this information will work for you.

Who invented JavaScript?

JavaScript language was invented by Brendan Eich in 1995. JavaScript is inspired by Java Programming Language. The first name of JavaScript was Mocha which was named by Marc Andreessen, Marc Andreessen is the founder of Netscape and in the same year Mocha was renamed LiveScript, and later in December 1995, it was renamed JavaScript which is still in trend.

What is JavaScript?

JavaScript is a client-side scripting language used with HTML (Hypertext Markup Language). JavaScript is an Interpreted / Oriented language called JS in programming language JavaScript code can be run on any normal web browser. To run the code of JavaScript, we have to enable JavaScript of Web Browser. But some web browsers already have JavaScript enabled.

Today almost all websites are using it as web technology, mind is that there is maximum scope in JavaScript in the coming time, so if you want to become a programmer, then you can be very beneficial to learn JavaScript.

JavaScript Hello World Program

In JavaScript, ‘document.write‘ is used to represent a string on a browser.

<script type="text/javascript">
	document.write("Hello World!");
</script>

How to comment JavaScript code?

  • For single line comment in JavaScript we have to use // (double slashes)
  • For multiple line comments we have to use / * – – * /
<script type="text/javascript">

//single line comment

/* document.write("Hello"); */

</script>

Advantages and Disadvantages of JavaScript

#javascript #javascript code #javascript hello world #what is javascript #who invented javascript

Hire Dedicated JavaScript Developers -Hire JavaScript Developers

It is said that a digital resource a business has must be interactive in nature, so the website or the business app should be interactive. How do you make the app interactive? With the use of JavaScript.

Does your business need an interactive website or app?

Hire Dedicated JavaScript Developer from WebClues Infotech as the developer we offer is highly skilled and expert in what they do. Our developers are collaborative in nature and work with complete transparency with the customers.

The technology used to develop the overall app by the developers from WebClues Infotech is at par with the latest available technology.

Get your business app with JavaScript

For more inquiry click here https://bit.ly/31eZyDZ

Book Free Interview: https://bit.ly/3dDShFg

#hire dedicated javascript developers #hire javascript developers #top javascript developers for hire #hire javascript developer #hire a freelancer for javascript developer #hire the best javascript developers

Niraj Kafle

1589255577

The essential JavaScript concepts that you should understand

As a JavaScript developer of any level, you need to understand its foundational concepts and some of the new ideas that help us developing code. In this article, we are going to review 16 basic concepts. So without further ado, let’s get to it.

#javascript-interview #javascript-development #javascript-fundamental #javascript #javascript-tips