diff --git a/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.html b/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.html new file mode 100644 index 000000000..5e2323b91 --- /dev/null +++ b/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.html @@ -0,0 +1,33 @@ + + + + + + + diff --git a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.scss b/client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.scss similarity index 100% rename from client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.scss rename to client/src/app/+my-account/my-account-videos/modals/live-stream-information.component.scss 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 @@ +import { Component, ElementRef, ViewChild } from '@angular/core' +import { LiveVideoService, Video } from '@app/shared/shared-main' +import { NgbModal } from '@ng-bootstrap/ng-bootstrap' + +@Component({ + selector: 'my-live-stream-information', + templateUrl: './live-stream-information.component.html', + styleUrls: [ './live-stream-information.component.scss' ] +}) +export class LiveStreamInformationComponent { + @ViewChild('modal', { static: true }) modal: ElementRef + + video: Video + rtmpUrl = '' + streamKey = '' + + constructor ( + private modalService: NgbModal, + private liveVideoService: LiveVideoService + ) { } + + show (video: Video) { + this.video = video + this.rtmpUrl = '' + this.streamKey = '' + + this.loadLiveInfo(video) + + this.modalService + .open(this.modal, { centered: true }) + } + + private loadLiveInfo (video: Video) { + this.liveVideoService.getVideoLive(video.id) + .subscribe(live => { + this.rtmpUrl = live.rtmpUrl + this.streamKey = live.streamKey + }) + } +} diff --git a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.html b/client/src/app/+my-account/my-account-videos/modals/video-change-ownership.component.html similarity index 96% rename from client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.html rename to client/src/app/+my-account/my-account-videos/modals/video-change-ownership.component.html index 9d809d2bf..c7c5a0b69 100644 --- a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.html +++ b/client/src/app/+my-account/my-account-videos/modals/video-change-ownership.component.html @@ -16,7 +16,7 @@ -