1 import { Component, ElementRef, ViewChild } from '@angular/core'
2 import { Video } from '@app/shared/shared-main'
3 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4 import { LiveVideo } from '@shared/models'
5 import { LiveVideoService } from './live-video.service'
8 selector: 'my-live-stream-information',
9 templateUrl: './live-stream-information.component.html',
10 styleUrls: [ './live-stream-information.component.scss' ]
12 export class LiveStreamInformationComponent {
13 @ViewChild('modal', { static: true }) modal: ElementRef
19 private modalService: NgbModal,
20 private liveVideoService: LiveVideoService
27 this.loadLiveInfo(video)
30 .open(this.modal, { centered: true })
33 private loadLiveInfo (video: Video) {
34 this.liveVideoService.getVideoLive(video.id)
35 .subscribe(live => this.live = live)