Video playback and call decline message handled
This commit is contained in:
parent
6e5966f847
commit
d34d37d114
@ -361,15 +361,4 @@ getDoughnutChartData(){
|
||||
|
||||
})
|
||||
}
|
||||
// openPlayer(){
|
||||
// let dialogRef = this.dialog.open(VideoPlayerComponent,{
|
||||
// maxWidth: '100vw',
|
||||
// maxHeight: '100vh',
|
||||
// height: '80%',
|
||||
// width: '80%',
|
||||
// disableClose: false,
|
||||
// panelClass:'video-player'
|
||||
// })
|
||||
// }
|
||||
|
||||
}
|
||||
@ -371,6 +371,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
||||
console.log(data)
|
||||
if(data == 'decline'){
|
||||
this.incomingDialogOpened = false
|
||||
this.socket.emit('callStatus',{random_string:curr_pd_info.random_string,status:'declined',status_code:3})
|
||||
}
|
||||
else {
|
||||
this.incomingDialogOpened = false
|
||||
|
||||
@ -146,8 +146,12 @@
|
||||
</button> </span>
|
||||
<!-- <div class="fab-group" *ngIf="master.fk_pd_type == '3'"> -->
|
||||
<!-- </div> -->
|
||||
<button *ngIf="master.fk_pd_type == '3'" mat-stroked-button class="mr-1 mb-1" color="primary" (click)="openPlayer()">
|
||||
<mat-icon>play_circle_filled</mat-icon>
|
||||
<strong>Play</strong>
|
||||
</button>
|
||||
<button *ngIf="master.fk_pd_type == '3'" mat-button mat-raised-button class="mr-1 mb-1" color="primary" (click)="openVideoChat()">
|
||||
<mat-icon>videocam</mat-icon>
|
||||
<mat-icon>videocam</mat-icon>
|
||||
<strong>Call</strong>
|
||||
</button>
|
||||
<button mat-raised-button class="mr-1 mb-1" color="primary" style="cursor: not-allowed !important;">
|
||||
|
||||
@ -21,6 +21,7 @@ import { InitiateAdditionalPdComponent } from './../initiate-additional-pd/initi
|
||||
import Swal from 'sweetalert2';
|
||||
import { VideoChatComponent } from 'app/video-chat/video-chat.component';
|
||||
import { MastersComponent } from 'app/settings/masters/masters.component';
|
||||
import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-pd',
|
||||
@ -126,6 +127,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
// }
|
||||
]
|
||||
};
|
||||
videoSrc: any = null;
|
||||
|
||||
constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder,
|
||||
private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent) {
|
||||
@ -145,7 +147,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
// this.masterRandomString = this.route.snapshot.params['rdmstr'];
|
||||
this.viewPdDetails(this.viewID,this.masterRandomString);
|
||||
this.getAllNotes();
|
||||
|
||||
this.getVideoUrl(this.viewID,this.masterRandomString)
|
||||
}
|
||||
pd_QC_Rating: Number;
|
||||
|
||||
@ -628,4 +630,26 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
panelClass:'video-chat'
|
||||
})
|
||||
}
|
||||
openPlayer(){
|
||||
if(this.videoSrc == null) {
|
||||
this.notifier.notify('info',"No Videos Found");
|
||||
return;
|
||||
}
|
||||
let dialogRef = this.dialog.open(VideoPlayerComponent,{
|
||||
data:{videoUrl:this.videoSrc},
|
||||
maxWidth: '100vw',
|
||||
maxHeight: '100vh',
|
||||
height: '80%',
|
||||
width: '80%',
|
||||
disableClose: false,
|
||||
panelClass:'video-player'
|
||||
})
|
||||
}
|
||||
getVideoUrl(pd_id,randomStr){
|
||||
let params = {"pd_id":pd_id,"random_string":randomStr}
|
||||
this._pd.getRecordedPlaybackUrl(params).subscribe(result=>{
|
||||
this.videoSrc=result['url'];
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@ -902,4 +902,7 @@ export class PdTrigerService {
|
||||
saveCusVideo(params) {
|
||||
return this._http.post(this.apiUrl+'saveCusVideo',params);
|
||||
}
|
||||
getRecordedPlaybackUrl(params){
|
||||
return this._http.post(this.apiUrl+'getVideoURL',params)
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
</button> -->
|
||||
</div>
|
||||
<!-- <mat-video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"></mat-video> -->
|
||||
<mat-video title="My Tutorial Title" [autoplay]="true" [preload]="true" [fullscreen]="true" [download]="false" color="primary" spinner="spin" poster="image.jpg">
|
||||
<mat-video title="Recorded Video" [autoplay]="true" [preload]="true" [fullscreen]="true" [download]="false" color="primary" spinner="spin" poster="../../assets/images/img/video-icon.png">
|
||||
<source matVideoSource [src]="videoSrc" type="video/webm">
|
||||
<!-- <source src="tutorial.webm" type="video/webm"> -->
|
||||
<!-- <track matVideoTrack src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English"> -->
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
selector: 'app-video-player',
|
||||
@ -7,13 +8,20 @@ import { Component, OnInit } from '@angular/core';
|
||||
})
|
||||
export class VideoPlayerComponent implements OnInit {
|
||||
videoSrc
|
||||
// = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'
|
||||
// = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4'
|
||||
constructor() { }
|
||||
constructor( @Inject(MAT_DIALOG_DATA) public data:any,private matDialogRef:MatDialogRef<VideoPlayerComponent>) {
|
||||
if(data) {
|
||||
if(data.hasOwnProperty('videoUrl') && data.videoUrl && data.videoUrl != null) {
|
||||
this.videoSrc = data.videoUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
let video_blob = localStorage.getItem('blob_url');
|
||||
if(video_blob) {
|
||||
this.videoSrc = video_blob;
|
||||
// this.videoSrc = video_blob;
|
||||
console.log(this.videoSrc);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
ng6-seed/src/assets/images/img/video-icon.png
Normal file
BIN
ng6-seed/src/assets/images/img/video-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Loading…
Reference in New Issue
Block a user