Mini Project Final
Mini Project Final
1.1 Background
The history of music players, from physical formats like cassettes, CDs, and MP3 players to
digital solutions in web browsers.
Rise of web-based music players and the role of modern web technologies (HTML, CSS,
JavaScript) in creating simple, efficient music players.
1.2 Objective
To design and implement a functional and interactive music player using HTML, CSS, and
JavaScript.
Features include basic controls such as play, pause, volume control, and playlist
management.
The goal is to create a user-friendly interface and a seamless music listening experience.
Purpose: Build a browser-based music player that allows users to play audio files without
installing additional software.
Scope: This project will focus only on front-end development. It will not include advanced
features like music streaming, cloud storage, or server-side processing.
1.4 Limitations
The music player will support only common audio formats like MP3 and WAV.
The project will not involve advanced features such as user authentication or music
recommendations.
Limited support for different browsers may exist, especially with older browser versions.
Chapter 2: Feasibility Study
Cost-effectiveness: The project uses open-source tools (HTML, CSS, JavaScript) with no
significant financial costs.
The project relies on mature web technologies, which are well-supported across modern
browsers.
The music player will be tested across various devices to ensure accessibility and usability.
In Chapter 3, we explore the detailed requirements and the analysis process behind the development
of the music player. This chapter includes problem definitions, planning and scheduling methods,
software/hardware requirements, and an explanation of the chosen Software Development Life
Cycle (SDLC) model.
The primary goal of this project is to create a functional and user-friendly music player that runs
directly in web browsers, eliminating the need for additional software installation. The system must
fulfill the following requirements:
Audio Playback: The player must support playing audio files, such as MP3 and WAV, and
provide basic controls such as play, pause, and skip.
Playlist Management: The player should allow users to add, remove, and reorder songs in
the playlist, with the ability to shuffle and repeat songs.
Responsive Design: The player must be usable across a variety of devices, including
desktops, laptops, and mobile phones.
Customization: Users should be able to control aspects like volume and seek position of the
audio.
The challenge is to build a simple yet powerful player using front-end technologies (HTML, CSS,
JavaScript) that can be integrated with minimal external dependencies.
In this section, we break down the project into phases and set deadlines for each task to ensure
timely completion. We use tools like Gantt charts and flow charts to map out the development
process.
Flow Chart: A flow chart will illustrate the general flow of the user experience, showing how
the user interacts with the player, from selecting a song to playing it.
Gantt Chart: A Gantt chart will be used to set a timeline for tasks like designing the user
interface, implementing the playlist system, and testing the player.
PERT Chart: The PERT (Program Evaluation and Review Technique) chart will highlight the
relationships and dependencies between tasks, helping identify critical paths and ensuring
that tasks are completed in the right order.
Project Phases:
1. Design Phase: Creating wireframes and UI mockups, as well as planning the structure of the
code.
2. Development Phase: Coding the functionalities like audio playback, playlist handling, UI
design, and responsiveness.
Chapter 4: Survey of Technology
In Chapter 4, we provide a detailed overview of the technologies that will be used to build the music
player. This chapter surveys the various front-end and back-end technologies, tools, and APIs that will
be utilized during development. We also explain the development environment and tools that are
chosen for creating the application.
This section introduces the technology stack used in the project. Since the music player is a browser-
based application, the focus is on web technologies that will provide a smooth and interactive
experience.
Frontend Technologies:
o HTML5: The backbone of the music player interface. HTML will be used to structure
the audio controls, playlists, and other UI elements.
o CSS3: Used to style the music player’s interface, making it visually appealing and
responsive across devices (mobile, tablet, desktop).
o JavaScript: JavaScript will handle the functionality of the music player, such as
playing/pausing audio, skipping tracks, and managing the playlist. JavaScript will also
interact with the HTML5 <audio> API to control audio playback.
Backend:
o No Backend (Frontend Only): This project does not require a server-side component.
All data (e.g., playlist, audio file selection) will be handled on the client-side using
JavaScript. There is no need for a database since the project focuses on local or
session storage.
Local Storage:
o For storing user preferences (like volume, last played song, and playlist) on the client
side, we will use the browser’s Local Storage API. This allows the player to
remember settings between sessions.
Frontend Technologies:
o HTML5: Provides a semantic structure for the music player’s interface. Elements such
as <audio>, <button>, <div>, and <input> are used to build the audio controls and
display.
o CSS3: Helps in designing the layout and responsiveness of the music player. Media
queries will be used to adjust the layout based on the device’s screen size (mobile-
first design).
Chapter 5 focuses on providing a detailed description of the core modules and features of the music
player, which are essential to its functionality. Each module is broken down into its individual
components, describing its role in the overall system. This chapter helps in outlining the structure
and behavior of the music player before the actual development begins, ensuring a clear
understanding of how the system will function.
This module is responsible for controlling the audio playback functionality of the music player.
Functionality:
o Users can also control the playback position using a slider, allowing them to skip
forward or rewind to a specific point in the audio file.
o The module will be integrated with the HTML5 Audio API, which will handle the
audio loading, playing, and control features.
Key Features:
o Displaying the current time of the track and total track duration.
This module is responsible for managing the list of songs that the user can select and play.
Functionality:
o Users can add songs, remove them, and reorder the tracks in the playlist.
o The module should also support the shuffle and repeat functionality, giving the user
more control over how the music is played.
Key Features:
o Reorder Playlist.
The UI module is focused on the design and user experience of the music player.
Functionality:
o This module handles the layout and the elements that users interact with.
o It includes buttons for playing, pausing, skipping tracks, and adjusting volume.
o The UI should be clean and simple, ensuring ease of use, with a modern and
responsive design that works across multiple devices (desktop and mobile).
Key Features:
o Play/Pause Button.
o Volume Control.
This module handles the persistent storage of user preferences, so that the player can remember
user settings and playback states.
Functionality:
o This module uses the LocalStorage API to save information like the last song played,
volume level, and whether the playlist is shuffled or on repeat.
o On loading the music player, these preferences will be retrieved, so the player
behaves as it was when the user last used it.
Key Features:
o Data will persist across browser sessions (user doesn’t need to set preferences every
time they open the player).
5.5 Error Handling and Validation Module
This module deals with handling any errors that occur during playback or when interacting with the
music player.
Functionality:
o It ensures the player does not crash in case of issues like an unsupported file type or
missing audio source.
o Provides user feedback when errors occur, such as invalid file formats, empty playlist,
or missing songs.
Key Features:
o Graceful Error Recovery (such as loading a backup track or retrying after failure).
o Chapter 6 covers the system design of the music player, detailing how the different
modules and components of the application will be structured and interact with
each other. This chapter helps in visualizing the architecture of the system and
provides a clear understanding of how data flows between various parts of the
application. It includes diagrams, data flow, and the internal workings of the system.
o The Data Flow Diagram (DFD) represents the flow of data within the system, from
user input to system processing and output. The DFD helps visualize how different
modules interact and how data is passed from one module to another.
o 0-Level DFD: The highest-level DFD that represents the system as a whole. It shows
the system's input (user actions), processing (audio playback and playlist
management), and output (audio output and user interface updates).
o 1-Level DFD: This DFD breaks down the system into its core modules (Audio
Playback, Playlist Management, User Interface, Local Storage). It shows how data
flows within and between these modules.
o 2-Level DFD: Further breaking down each module. For example, the Audio Playback
module might be broken down into actions like play, pause, stop, and seek. This
detailed diagram helps understand the internal operations of each module.
o 3-Level DFD (optional): For more complex systems, this could break down the
lowest-level operations, such as button press handling or specific interactions with
the Local Storage API.
o User: Represents the individual using the music player. Attributes include user
preferences (e.g., volume, last played track).
o Song/Track: Represents individual audio files with attributes such as song title, artist,
album, file path, and duration.
o Settings: Stores user-specific settings like volume control, shuffle, and repeat
preferences.
o The ER diagram visualizes how these entities are related. For instance:
o A User has many Playlists.
Chapter 7 delves into the detailed design of the music player, providing an in-depth look at the
interface, user interaction, and the program’s functionality. This chapter includes design elements
such as input/output screens, validation checks, and specific program code implementations that will
bring the system to life. It builds on the preliminary design described in Chapter 5 and converts it into
a more practical, executable structure.
This section focuses on the user interface (UI) and the input/output screens that the user interacts
with. The design of the input screens is essential in ensuring a smooth and intuitive experience for
the user.
o Progress Bar: Displays the current position in the song and allows the user to seek
through it.
o Song Information Display: Shows the title of the current song, artist, and album.
Playlist Screen:
o Displays the list of songs available in the playlist. Each song entry will show the song
name, artist, and a play button.
Settings/Preferences Screen:
o Allows the user to manage preferences such as shuffle, repeat, volume level, and
last played song.
o This screen will display any error or warning messages if the player encounters
issues, such as an unsupported file format or no songs in the playlist.
These screens aim to ensure the music player is not only functional but also easy to use, responsive,
and aesthetically appealing.
o Ensure that the audio files uploaded are of valid formats (e.g., MP3, WAV, etc.).
o The player should provide feedback if an unsupported file type is uploaded (e.g.,
using an error message).
Playlist Validation:
o Verify that the playlist is not empty before attempting to play music. If there are no
songs in the playlist, the player should display a message to prompt the user to add
songs.
o Ensure that the playlist is not corrupted, with tracks missing or in an invalid format.
Volume Validation:
o The volume control should be restricted between 0% and 100%. It should not allow
values outside this range, and any invalid inputs should be corrected automatically.
o Ensure that the seek bar is only moved within the length of the audio track. If a user
tries to seek beyond the track’s duration, the player should reset the position to the
end of the track.
o If a user changes settings (e.g., shuffle, repeat, or volume), ensure that the data is
correctly stored in LocalStorage and retrieved on next page load.
These validation checks prevent runtime errors and unexpected behaviors, improving the stability
and reliability of the music player.
Program Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="main">
<div id="left"></div>
<div id="right">
<div id="all-songs">
</div>
</div>
</div>
<div id="player">
</div>
<script src="script.js"></script>
</body>
</html>
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: gilroy;
color: #fff;
html , body{
height: 100%;
width: 100%;
#main{
height: 85%;
width: 100%;
background-color: #111;
display: flex;
#left{
height: 100%;
background-color: #333;
width: 45%;
/* background-image: url(https://m.media-amazon.com/images/I/91zTlD7AY1L.jpg); */
background-size: cover;
background-position: top;
#right{
height: 100%;
width: 55%;
/* background-color: blue; */
padding: 0 3vw;
#right h3{
font-size: 40px;
#all-songs{
/* background-color: red; */
height: 85%;
margin-top: 30px;
.song-card{
display: flex;
align-items: center;
justify-content: space-between;
.song-card:hover{
background-color: #1e1e1e;
.song-card:nth-last-child(1){
.song-card .part1{
display: flex;
align-items: center;
pointer-events: none;
}
.song-card img{
height: 55px;
width: 55px;
margin-right: 20px;
.song-card h2{
font-size: 22px;
font-weight: 600;
.song-card h6{
font-weight: 500;
font-size: 16px;
#player{
height: 15%;
width: 100%;
background-color: #000000;
display: flex;
align-items: center;
justify-content: center;
gap: 15px;
#player h3{
padding: 10px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
}
#player h3 i{
font-size: 24px;
#player h3:active{
scale: 0.93;
var arr = [
{ songName: "Pehle Bhi main", url: "./songs/Pehle Bhi Main.mp3", img: "./images/animal.jpg" },
{ songName: "Ram siya ram", url: "./songs/Ram Siya Ram.mp3", img: "./images/ram.jpg" },
var selectedSong = 0
function mainFunction() {
<div class="part1">
<h2>${elem.songName}</h2>
</div>
<h6>3:56</h6>
</div>`
})
allSongs.innerHTML = clutter
audio.src = arr[selectedSong].url
poster.style.backgroundImage = `url(${arr[selectedSong].img})`
mainFunction()
selectedSong = dets.target.id
mainFunction()
flag = 1
audio.play()
})
var flag = 0
play.addEventListener("click", function () {
if (flag == 0) {
mainFunction()
audio.play()
flag = 1
} else {
mainFunction()
audio.pause()
flag = 0
})
forward.addEventListener("click", function () {
selectedSong++
mainFunction()
audio.play()
}else{
forward.style.opacity = 0.4
})
backward.addEventListener("click", function () {
if (selectedSong > 0) {
selectedSong--
mainFunction()
audio.play()
}else{
backward.style.opacity = 0.4
})