]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - 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
1import { Component, ElementRef, ViewChild } from '@angular/core'
2import { Video } from '@app/shared/shared-main'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { LiveVideo } from '@shared/models'
5import { LiveVideoService } from './live-video.service'
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
16 live: LiveVideo
17
18 constructor (
19 private modalService: NgbModal,
20 private liveVideoService: LiveVideoService
21 ) { }
22
23 show (video: Video) {
24 this.video = video
25 this.live = undefined
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)
35 .subscribe(live => this.live = live)
36 }
37}