aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.ts40
1 files changed, 40 insertions, 0 deletions
diff --git a/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.ts b/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.ts
new file mode 100644
index 000000000..a5885a8e7
--- /dev/null
+++ b/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.ts
@@ -0,0 +1,40 @@
1import { Component, ElementRef, ViewChild } from '@angular/core'
2import { LiveVideoService, Video } from '@app/shared/shared-main'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4
5@Component({
6 selector: 'my-live-stream-information',
7 templateUrl: './live-stream-information.component.html',
8 styleUrls: [ './live-stream-information.component.scss' ]
9})
10export class LiveStreamInformationComponent {
11 @ViewChild('modal', { static: true }) modal: ElementRef
12
13 video: Video
14 rtmpUrl = ''
15 streamKey = ''
16
17 constructor (
18 private modalService: NgbModal,
19 private liveVideoService: LiveVideoService
20 ) { }
21
22 show (video: Video) {
23 this.video = video
24 this.rtmpUrl = ''
25 this.streamKey = ''
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 => {
36 this.rtmpUrl = live.rtmpUrl
37 this.streamKey = live.streamKey
38 })
39 }
40}