diff --git a/Chavah.NetCore/Controllers/CdnController.cs b/Chavah.NetCore/Controllers/CdnController.cs index 6147d54..32ff89c 100644 --- a/Chavah.NetCore/Controllers/CdnController.cs +++ b/Chavah.NetCore/Controllers/CdnController.cs @@ -91,8 +91,7 @@ public RedirectResult GetAdAnnouncement() "ad2x.mp3", "ad3x.mp3", "ad4x.mp3", - "ad5x.mp3", - "ad6x.mp3", + "ad5x.mp3" }; // Sukkot 2024 ad: play it every even hour. diff --git a/Chavah.NetCore/wwwroot/js/Services/AdAnnouncerService.ts b/Chavah.NetCore/wwwroot/js/Services/AdAnnouncerService.ts index fa01897..fb7f687 100644 --- a/Chavah.NetCore/wwwroot/js/Services/AdAnnouncerService.ts +++ b/Chavah.NetCore/wwwroot/js/Services/AdAnnouncerService.ts @@ -11,6 +11,7 @@ constructor( private readonly audioPlayer: AudioPlayerService, private readonly homeViewModel: Server.HomeViewModel) { + this.lastAnnouncementTime.setDate(this.lastAnnouncementTime.getDate() - 1); // set last announcement time to yesterday. } hasPendingAnnouncement(): boolean { @@ -33,21 +34,7 @@ playAdAnnouncement() { const adUrl = "/api/cdn/getAdAnnouncement"; - - // Check if this is a redirect. If so, find the target of the redirect and play that. - // If not, play the URL. - // Reason is, on iOS we use native audio to play the URL. It can have issues playing a redirect result. - window.fetch(adUrl) - .then(res => { - const isRedirect = res.status >= 300 && res.status < 400; - if (isRedirect) { - const redirectUrl = res.headers.get("Location"); - this.audioPlayer.playNewUri(redirectUrl || adUrl); - } - }, err => { - console.warn("Unable to fetch ad announcement URL due to error", err); - this.audioPlayer.playNewUri(adUrl); - }); + this.audioPlayer.playNewUri(adUrl); } }