Add vid checker
parent
fdac58f4dc
commit
b9ee133acb
|
|
@ -1,7 +1,7 @@
|
|||
<secondary-page-component [hideSideBarOnMobile]="true" >
|
||||
<div mainContent class="mapWrapper">
|
||||
<div class="video-container">
|
||||
<img style="width: 100%" *ngIf="!showVideo" [src]="pleaseWait">
|
||||
<h1 *ngIf="!showVideo">{{message}}</h1>
|
||||
<video [class.opacity-zero]="!showVideo" *ngIf="!error" style="width:100%" [src]="videoSrc" controls [poster]="poster" (error)="vidError()"></video>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { BibleVerseService } from './../../services/bible-verse.service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
selector: 'live-stream-component',
|
||||
|
|
@ -13,6 +14,8 @@ export class LiveStreamComponent implements OnInit {
|
|||
public sermonVideo: string = 'https://ofbbutte.com/static/media/video/sermon.mp4';
|
||||
public pleaseWait: string = 'https://ofbbutte.com/static/media/video/PleaseWait.jpg';
|
||||
public clickToPlay: string = 'https://ofbbutte.com/static/media/video/ClickToPlay.jpg';
|
||||
public message: string = "Please Wait";
|
||||
public isReady: boolean = false;
|
||||
|
||||
|
||||
public videoSrc: string = this.sermonVideo;
|
||||
|
|
@ -20,17 +23,33 @@ export class LiveStreamComponent implements OnInit {
|
|||
public error: boolean = false;
|
||||
public showVideo: boolean = false;
|
||||
|
||||
constructor() { }
|
||||
constructor(private http: HttpClient) { }
|
||||
|
||||
private interval;
|
||||
ngOnInit() {
|
||||
this.interval = setInterval(() => {
|
||||
this.http.get('assets/json/message.json').subscribe(res => {
|
||||
console.log(res);
|
||||
this.message = (<any>res).message;
|
||||
this.isReady= (<any>res).isReady;
|
||||
if (this.isReady === true) {
|
||||
this.showVideo = true;
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
|
||||
setTimeout(() => {
|
||||
if (!this.error) {
|
||||
this.showVideo = true;
|
||||
}
|
||||
}, 3000)
|
||||
this.isReady = true;
|
||||
this.showVideo = true;
|
||||
this.videoSrc = '';
|
||||
this.videoSrc = this.videoSrc;
|
||||
clearInterval(this.interval);
|
||||
}, 12000)
|
||||
}
|
||||
|
||||
public async vidError() {
|
||||
console.log('err');
|
||||
return;
|
||||
if (this.videoSrc === '') return;
|
||||
this.error = true;
|
||||
setTimeout(async () => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"isReady":false,
|
||||
"message": "Please Wait..."
|
||||
}
|
||||
Loading…
Reference in New Issue