• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

Download Code Listen to music online using HTML, CSS, JS

AnonyViet by AnonyViet
June 14, 2024
in Tips
0

Online music listening code written in HTML, CSS, JS is shared by author Nguyen Anh Nhan on Github. You can download and edit the interface and song list to your liking. The author also includes detailed instructions for you to customize to your liking.

Join the channel Telegram belong to AnonyViet 👉 Link 👈

Download Code Listen to music online

According to the author, the Online Music Listening Code using HTML and CSS is quite simple so it doesn't need much explanation. One thing you need to pay attention to on the HTML page is the Meta Tag: viewport. Why? Because without this Meta tag, display on mobile devices will have problems.

If you don't know HTML and CSS, you can Download the course for free shared by AnonyViet.

Download Code Listen to music online using HTML, CSS, JS

Link Source: MusicPlayer Repository (Github)

Demo: Demo Player

CODE EXPLANATION

To edit the playlist of Online Music Listening Code, just edit variable songs. songs(Array) in the following form:

Download Code Listen to music online using HTML, CSS, JS

Regarding Javascript, there are the following Functions:

  • shuffle.shuffle
  • playPause
  • showHover
  • playFromClickedPos
  • checkBuffering
  • selectTrack
  • initPlayer

Shuffle function:

This function will mix the order of items in the array in random order. For those who want to listen to music out of order, the songs will be played randomly.

playPause function:

This function Handle event click on the Play/Pause button. Stop music/resume playback from last stop.

showHover function:

Here this function will be responsible for the click event on the slider displaying the % duration of the song played. Click to play from where you just clicked.

When clicked, an argument is passed which is information about the event. This Event includes the mouse click position (Event.clientX is the mouse position calculated horizontally across the web (The purpose is to find out where the mouse moves to calculate the time)). seekT is the distance from the starting point of the display bar to the mouse point. seekLoc is the value in seconds.

This function will be CALLED CONTINUOUSLY when the mouse hovers over the slider. (The purpose is to set the value)

hideHover function:

Mouse moving away from the slider will call this event. The purpose is to reset the strip displaying the selected mouse part (from the starting point to the mouse position) to the starting point (sHover.width = 0).

In addition, this event also sets the timer text to the starting point.

function updateCurrTime:

Call to set the time. If it's 100% (all cards are gone), change the cards and set the time to start.

checkBuffering function:

Check if the music has finished loading.

selectTrack function:

Change tracks (forward/backward). Essentially, it's just increasing or decreasing the currIndex variable and setting the values ​​according to currIndex.

initPlayer function:

Start the player and sequentially assign events.

Player is edited/developed from the interface source of: CodePen

According to: Nguyen Anh Nhan

Previous Post

How to use NotebookLM to summarize and analyze internal documents

Next Post

Instructions for buying Water Bus tickets on Zalo

AnonyViet

AnonyViet

Related Posts

Instructions to receive Claude Fable 5 for free for 30 days
Tips

Instructions to receive Claude Fable 5 for free for 30 days

June 15, 2026
Delete all Event Logs on Windows to remove traces of activity
Tips

Delete all Event Logs on Windows to remove traces of activity

June 15, 2026
Instructions for creating Minecraft-style food photos
Tips

Instructions for creating Minecraft-style food photos

June 9, 2026
Get free Cambridge courses to prepare for IELTS, Starters, Movers
Tips

Get free Cambridge courses to prepare for IELTS, Starters, Movers

June 4, 2026
How to record reaction videos with Android phones, no app needed
Tips

How to record reaction videos with Android phones, no app needed

June 1, 2026
Instructions on how to get Google AI Pro 1 year for free for new accounts
Tips

Instructions on how to get Google AI Pro 1 year for free for new accounts

June 1, 2026
Next Post
Instructions for buying Water Bus tickets on Zalo

Instructions for buying Water Bus tickets on Zalo

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

Instructions to receive Claude Fable 5 for free for 30 days

Instructions to receive Claude Fable 5 for free for 30 days

June 15, 2026
Instructions on how to activate the new Siri on iOS 27

Instructions on how to activate the new Siri on iOS 27

June 15, 2026
Delete all Event Logs on Windows to remove traces of activity

Delete all Event Logs on Windows to remove traces of activity

June 15, 2026
Instructions on how to get the latest 200GB MultCloud for free in 2026

Instructions on how to get the latest 200GB MultCloud for free in 2026

June 14, 2026
Instructions to receive Claude Fable 5 for free for 30 days

Instructions to receive Claude Fable 5 for free for 30 days

June 15, 2026
Instructions on how to activate the new Siri on iOS 27

Instructions on how to activate the new Siri on iOS 27

June 15, 2026
Delete all Event Logs on Windows to remove traces of activity

Delete all Event Logs on Windows to remove traces of activity

June 15, 2026
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

Instructions to receive Claude Fable 5 for free for 30 days

Instructions to receive Claude Fable 5 for free for 30 days

June 15, 2026
Instructions on how to activate the new Siri on iOS 27

Instructions on how to activate the new Siri on iOS 27

June 15, 2026
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

6789 kv999

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

6789 kv999

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply