Skip to content

Commit

Permalink
Change tab title to match song name and artist
Browse files Browse the repository at this point in the history
  • Loading branch information
CommandString committed Sep 6, 2024
1 parent 3d35789 commit 908b172
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pages/sa.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ async function changeSong(
await switchAudio.value!.play();
document.title = `${currentSong.value!.name} by ${currentSong.value!.artists.join(', ')}`;
audio.value!.addEventListener('canplay', async () => {
switchAudio.value!.pause();
switchAudio.value!.currentTime = 0;
Expand Down Expand Up @@ -228,6 +230,7 @@ async function changeStation(station: APIStation | null) {
if (station === null) {
currentSong.value = null;
audio.value!.src = '';
document.title = 'San Andreas Radio';
if (!switchAudio.value?.paused) {
switchAudio.value!.pause();
Expand Down

0 comments on commit 908b172

Please sign in to comment.