Skip to content

Commit

Permalink
Update youtube-player.js
Browse files Browse the repository at this point in the history
  • Loading branch information
firofame authored Dec 9, 2024
1 parent c48a5c2 commit 197d058
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions youtube-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let buttons = document.querySelectorAll('#button-container button');

async function loadPlaylist() {
try {
const response = await fetch('playlist.json');
const response = await fetch('input.json');
if (!response.ok) {
throw new Error('Network response was not ok');
}
Expand All @@ -27,9 +27,9 @@ async function loadPlaylist() {
const buttonContainer = document.getElementById('button-container');
playlist.forEach(channel => {
const button = document.createElement('button');
button.dataset.channel = channel.channel_id;
button.textContent = channel.channel_name;
button.addEventListener('click', () => changeChannel(channel.channel_id));
button.dataset.channel = channel["channel-id"];
button.textContent = channel["name"];
button.addEventListener('click', () => changeChannel(channel["channel-id"]));
buttonContainer.appendChild(button);
});
buttons = document.querySelectorAll('#button-container button');
Expand Down

0 comments on commit 197d058

Please sign in to comment.