Podcast Player with Background Music
About this app
A podcast player app with background music
Podcast Player with Background Music Podcast Player with Background Music Podcast Your browser does not support the audio element. Play Podcast Background Music Your browser does not support the audio element. Play Background Music
Related apps
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Podcast Player with Background Music</title>
<meta name="description" content="A podcast player app with background music">
<meta name="keywords" content="podcast, music, player, background, app">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
// Get the audio elements
var podcastAudio = document.getElementById("podcast-audio");
var backgroundMusicAudio = document.getElementById("background-music-audio");
// Get the play/pause buttons
var podcastPlayButton = document.getElementById("podcast-play-button");
var backgroundMusicPlayButton = document.getElementById("background-music-play-button");
// Add event listeners to the play/pause buttons
podcastPlayButton.addEventListener("click", function() {
if (podcastAudio.paused) {
podcastAudio.play();
podcastPlayButton.innerHTML = '<i class="fa fa-pause"></i> Pause Podcast';
} else {
podcastAudio.pause();
podcastPlayButton.innerHTML = '<i class="fa fa-play"></i> Play Podcast';
}
});
backgroundMusicPlayButton.addEventListener("click", function() {
if (backgroundMusicAudio.paused) {
backgroundMusicAudio.play();
backgroundMusicPlayButton.innerHTML = '<i class="fa fa-pause"></i> Pause Background Music';
} else {
backgroundMusicAudio.pause();
backgroundMusicPlayButton.innerHTML = '<i class="fa fa-play"></i> Play Background Music';
}
});
});
} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>
<style>
/* App CSS Goes Here */
body {
background-color: #f8f9fa;
font-family: 'Roboto', sans-serif;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
text-align: center;
}
h1 {
color: #343a40;
font-size: 28px;
font-weight: bold;
margin-bottom: 20px;
}
.audio-container {
margin-bottom: 30px;
}
.audio-container audio {
width: 100%;
margin-top: 10px;
}
.play-button {
background-color: #007bff;
color: #fff;
border: none;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.play-button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Podcast Player with Background Music</h1>
<div class="audio-container">
<h3>Podcast</h3>
<audio id="podcast-audio" controls>
<source src="YOUR_PODCAST_URL" type="audio/mp3">
Your browser does not support the audio element.
</audio>
<button id="podcast-play-button" class="play-button"><i class="fa fa-play"></i> Play Podcast</button>
</div>
<div class="audio-container">
<h3>Background Music</h3>
<audio id="background-music-audio" controls>
<source src="YOUR_BACKGROUND_MUSIC_URL" type="audio/mp3">
Your browser does not support the audio element.
</audio>
<button id="background-music-play-button" class="play-button"><i class="fa fa-play"></i> Play Background Music</button>
</div>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!