Update live page
parent
a2edf88fb1
commit
6f26bb859d
|
|
@ -1,9 +1,14 @@
|
||||||
<secondary-page-component [hideSideBarOnMobile]="true" >
|
<secondary-page-component [hideSideBarOnMobile]="true" >
|
||||||
<div mainContent class="mapWrapper">
|
<div mainContent class="mapWrapper">
|
||||||
<div class="video-container">
|
<h2 *ngIf="!showVideo">{{message}}</h2>
|
||||||
<h1 *ngIf="!showVideo">{{message}}</h1>
|
<div class="video-container" *ngIf="showVideo">
|
||||||
<video [class.opacity-zero]="!showVideo" *ngIf="!error" style="width:100%" [src]="videoSrc" controls [poster]="poster" (error)="vidError()"></video>
|
<video [class.opacity-zero]="!showVideo" *ngIf="!error" style="width:100%" [src]="videoSrc" controls [poster]="poster" (error)="vidError()"></video>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="margin-top: 10px">
|
||||||
|
<button routerLink="/video" style="margin-top:5px; width:100%;" mat-stroked-button>
|
||||||
|
<b><i ofbicon style="margin-top:-4px; vertical-align: middle;">play_arrow</i> Click here for previous video services</b>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div sideBar ofbFadeInOnScroll>
|
<div sideBar ofbFadeInOnScroll>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,13 @@ export class LiveStreamComponent implements OnInit {
|
||||||
|
|
||||||
private interval;
|
private interval;
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.update();
|
||||||
this.interval = setInterval(() => {
|
this.interval = setInterval(() => {
|
||||||
|
this.update();
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
update() {
|
||||||
this.http.get<VideoServices>('assets/json/videoServices.json').subscribe(res => {
|
this.http.get<VideoServices>('assets/json/videoServices.json').subscribe(res => {
|
||||||
res.videos = res.videos.filter(v => v.archived === false);
|
res.videos = res.videos.filter(v => v.archived === false);
|
||||||
res.videos.forEach(v => v.date = DateTime.fromISO(v.date, {zone: 'America/Denver'}));
|
res.videos.forEach(v => v.date = DateTime.fromISO(v.date, {zone: 'America/Denver'}));
|
||||||
|
|
@ -52,23 +58,7 @@ export class LiveStreamComponent implements OnInit {
|
||||||
this.message = 'No Live Services';
|
this.message = 'No Live Services';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 3000);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async vidError() {
|
|
||||||
console.log('err');
|
|
||||||
return;
|
|
||||||
if (this.videoSrc === '') return;
|
|
||||||
this.error = true;
|
|
||||||
setTimeout(async () => {
|
|
||||||
this.error = false;
|
|
||||||
setTimeout(() => {
|
|
||||||
if (!this.error) {
|
|
||||||
this.showVideo = true;
|
|
||||||
}
|
|
||||||
}, 3000);
|
|
||||||
}, 3000);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue