diff --git a/src/app/content/hemat-app/monitoring/surveillance/surveillance.component.html b/src/app/content/hemat-app/monitoring/surveillance/surveillance.component.html index 9f1be77..0d40432 100644 --- a/src/app/content/hemat-app/monitoring/surveillance/surveillance.component.html +++ b/src/app/content/hemat-app/monitoring/surveillance/surveillance.component.html @@ -168,7 +168,7 @@
- + > --> + + +
@@ -189,9 +194,7 @@ class="card-img-top img-fluid" src="../../../../../assets/images/cctv.jpg" alt="Image 1" - (click)="onClick(item.videoUrl)" - (mouseenter)="onMouseEnter(item)" - (mouseleave)="onMouseLeave()" + (click)="loadStream(item.videoUrl)" /> diff --git a/src/app/content/hemat-app/monitoring/surveillance/surveillance.component.ts b/src/app/content/hemat-app/monitoring/surveillance/surveillance.component.ts index e4b8c5f..0b67614 100644 --- a/src/app/content/hemat-app/monitoring/surveillance/surveillance.component.ts +++ b/src/app/content/hemat-app/monitoring/surveillance/surveillance.component.ts @@ -26,12 +26,13 @@ export class SurveillanceComponent { public breadcrumb: any; showIframe = false; clicktrue = false; + cameras = [ { id: 1, name: "Pengadilan Agama Padang Cam 1", videoUrl: - "https://pdg2.cctvbadilag.my.id:5443/401900PTAPADANG/play.html?name=034163533934088379392939", + "https://wework-7-us.stream.iot-11.com:8080/hls/eb48441e886701e55bbk52/cprg5g0d9fpsg3dvh27gSD1XjuVVd8h8oWqjoFJ6.m3u8?signInfo=C6fuX1l4syLFPeCPQ476iYDjNU_WZC24E6oGVwBvK3k6iIhqjvzzQIAAO5rUJjWLfeqY6YpDPsRB9JGEQTL_ZpxUOJB_L0VfgPX45SAecU_6_6ybAVcK-m0xxUrcGr3_EvzF_d1czqOHplNUMYodotvkWWQ9yP0NOEYJhtMemSw", }, { id: 2, @@ -53,6 +54,7 @@ export class SurveillanceComponent { }, ]; + player: any; constructor( private router: Router, private deviceService: DeviceService, @@ -86,8 +88,27 @@ export class SurveillanceComponent { } ngAfterViewInit() { - //Called after ngAfterContentInit when the component's view has been initialized. Applies to components only. - //Add 'implements AfterViewInit' to the class. + const options = { + controls: true, + preload: "none", + techOrder: ["html5"], + html5: { + hls: { + overrideNative: !videojs.browser.IS_SAFARI, + }, + }, + }; + + this.player = videojs("streamplayer", options); + } + + loadStream(streamUrl) { + this.player.src({ + type: "application/x-mpegURL", + src: streamUrl, + }); + this.player.controls(true); + this.player.play(); } fetchData(buildingSelected, categorySelected, statusSelected) { @@ -132,28 +153,25 @@ export class SurveillanceComponent { }, 3000); } - onClick(videoUrl: string) { - const iframe = this.videoIframe.nativeElement; - iframe.src = videoUrl; - this.clicktrue = true; - } + // onClick(videoUrl: string) { + // const iframe = this.videoIframe.nativeElement; + // iframe.src = videoUrl; + // this.clicktrue = true; + // } - onMouseEnter(camera: any) { - console.log("enter"); - if (this.clicktrue === false) { - const iframe = this.videoIframe.nativeElement; - iframe.src = camera.videoUrl; - } + // onMouseEnter(camera: any) { + // if (this.clicktrue === false) { + // const iframe = this.videoIframe.nativeElement; + // iframe.src = camera.videoUrl; + // } + // this.showIframe = true; + // } - this.showIframe = true; - } - - onMouseLeave() { - console.log("leave"); - const iframe = this.videoIframe.nativeElement; - if (this.clicktrue === false) { - iframe.src = ""; - } - this.showIframe = false; - } + // onMouseLeave() { + // const iframe = this.videoIframe.nativeElement; + // if (this.clicktrue === false) { + // iframe.src = ""; + // } + // this.showIframe = false; + // } } diff --git a/src/index.html b/src/index.html index 826cc41..ff7dc8d 100644 --- a/src/index.html +++ b/src/index.html @@ -36,11 +36,15 @@ + + + +