]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-video-live/live-stream-information.component.ts
Refactor modal buttons style
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-video-live / live-stream-information.component.ts
CommitLineData
d846d99c 1import { Component, ElementRef, ViewChild } from '@angular/core'
f8c00564 2import { Video } from '@app/shared/shared-main'
d846d99c 3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
312644ce 4import { LiveVideo } from '@shared/models'
f8c00564 5import { LiveVideoService } from './live-video.service'
d846d99c
C
6
7@Component({
8 selector: 'my-live-stream-information',
9 templateUrl: './live-stream-information.component.html',
10 styleUrls: [ './live-stream-information.component.scss' ]
11})
12export class LiveStreamInformationComponent {
13 @ViewChild('modal', { static: true }) modal: ElementRef
14
15 video: Video
312644ce 16 live: LiveVideo
d846d99c
C
17
18 constructor (
19 private modalService: NgbModal,
20 private liveVideoService: LiveVideoService
21 ) { }
22
23 show (video: Video) {
24 this.video = video
312644ce 25 this.live = undefined
d846d99c
C
26
27 this.loadLiveInfo(video)
28
29 this.modalService
30 .open(this.modal, { centered: true })
31 }
32
33 private loadLiveInfo (video: Video) {
34 this.liveVideoService.getVideoLive(video.id)
312644ce 35 .subscribe(live => this.live = live)
d846d99c
C
36 }
37}