diff --git a/Client/src/app/components/live-stream/live-stream.component.html b/Client/src/app/components/live-stream/live-stream.component.html index 6307d38..714e7d0 100644 --- a/Client/src/app/components/live-stream/live-stream.component.html +++ b/Client/src/app/components/live-stream/live-stream.component.html @@ -1,9 +1,14 @@
-
-

{{message}}

+

{{message}}

+
-
+
+
+ +
diff --git a/Client/src/app/components/live-stream/live-stream.component.ts b/Client/src/app/components/live-stream/live-stream.component.ts index c34290c..e47055c 100644 --- a/Client/src/app/components/live-stream/live-stream.component.ts +++ b/Client/src/app/components/live-stream/live-stream.component.ts @@ -29,46 +29,36 @@ export class LiveStreamComponent implements OnInit { private interval; ngOnInit() { + this.update(); this.interval = setInterval(() => { - this.http.get('assets/json/videoServices.json').subscribe(res => { - res.videos = res.videos.filter(v => v.archived === false); - res.videos.forEach(v => v.date = DateTime.fromISO(v.date, {zone: 'America/Denver'})); - res.videos.sort((a, b) => { - if (a.date < b.date) return -1; - if (a.date === b.date) return 0; - return 1; - }); - var service = res.videos[0]; - - if (service) { - this.message = (service).message; - if (service.isReady === true) { - this.showVideo = true; - this.videoSrc = ''; - this.videoSrc = service.src; - clearInterval(this.interval); - } - } else { - this.message = 'No Live Services'; - } - }); - }, 3000); - + this.update(); + }, 3000); } - public async vidError() { - console.log('err'); - return; - if (this.videoSrc === '') return; - this.error = true; - setTimeout(async () => { - this.error = false; - setTimeout(() => { - if (!this.error) { + update() { + this.http.get('assets/json/videoServices.json').subscribe(res => { + res.videos = res.videos.filter(v => v.archived === false); + res.videos.forEach(v => v.date = DateTime.fromISO(v.date, {zone: 'America/Denver'})); + res.videos.sort((a, b) => { + if (a.date < b.date) return -1; + if (a.date === b.date) return 0; + return 1; + }); + var service = res.videos[0]; + + if (service) { + this.message = (service).message; + if (service.isReady === true) { this.showVideo = true; + this.videoSrc = ''; + this.videoSrc = service.src; + clearInterval(this.interval); } - }, 3000); - }, 3000); - + } else { + this.message = 'No Live Services'; + } + }); } + + }