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)
|
console.log(data)
|
||||||
if(data == 'decline'){
|
if(data == 'decline'){
|
||||||
this.incomingDialogOpened = false
|
this.incomingDialogOpened = false
|
||||||
|
this.socket.emit('callStatus',{random_string:curr_pd_info.random_string,status:'declined',status_code:3})
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.incomingDialogOpened = false
|
this.incomingDialogOpened = false
|
||||||
|
|||||||
@ -146,8 +146,12 @@
|
|||||||
</button> </span>
|
</button> </span>
|
||||||
<!-- <div class="fab-group" *ngIf="master.fk_pd_type == '3'"> -->
|
<!-- <div class="fab-group" *ngIf="master.fk_pd_type == '3'"> -->
|
||||||
<!-- </div> -->
|
<!-- </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()">
|
<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>
|
<strong>Call</strong>
|
||||||
</button>
|
</button>
|
||||||
<button mat-raised-button class="mr-1 mb-1" color="primary" style="cursor: not-allowed !important;">
|
<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 Swal from 'sweetalert2';
|
||||||
import { VideoChatComponent } from 'app/video-chat/video-chat.component';
|
import { VideoChatComponent } from 'app/video-chat/video-chat.component';
|
||||||
import { MastersComponent } from 'app/settings/masters/masters.component';
|
import { MastersComponent } from 'app/settings/masters/masters.component';
|
||||||
|
import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-pd',
|
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,
|
constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder,
|
||||||
private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent) {
|
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.masterRandomString = this.route.snapshot.params['rdmstr'];
|
||||||
this.viewPdDetails(this.viewID,this.masterRandomString);
|
this.viewPdDetails(this.viewID,this.masterRandomString);
|
||||||
this.getAllNotes();
|
this.getAllNotes();
|
||||||
|
this.getVideoUrl(this.viewID,this.masterRandomString)
|
||||||
}
|
}
|
||||||
pd_QC_Rating: Number;
|
pd_QC_Rating: Number;
|
||||||
|
|
||||||
@ -628,4 +630,26 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
|||||||
panelClass:'video-chat'
|
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) {
|
saveCusVideo(params) {
|
||||||
return this._http.post(this.apiUrl+'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> -->
|
</button> -->
|
||||||
</div>
|
</div>
|
||||||
<!-- <mat-video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"></mat-video> -->
|
<!-- <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 matVideoSource [src]="videoSrc" type="video/webm">
|
||||||
<!-- <source src="tutorial.webm" type="video/webm"> -->
|
<!-- <source src="tutorial.webm" type="video/webm"> -->
|
||||||
<!-- <track matVideoTrack src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English"> -->
|
<!-- <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({
|
@Component({
|
||||||
selector: 'app-video-player',
|
selector: 'app-video-player',
|
||||||
@ -7,13 +8,20 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class VideoPlayerComponent implements OnInit {
|
export class VideoPlayerComponent implements OnInit {
|
||||||
videoSrc
|
videoSrc
|
||||||
|
// = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'
|
||||||
// = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.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() {
|
ngOnInit() {
|
||||||
let video_blob = localStorage.getItem('blob_url');
|
let video_blob = localStorage.getItem('blob_url');
|
||||||
if(video_blob) {
|
if(video_blob) {
|
||||||
this.videoSrc = video_blob;
|
// this.videoSrc = video_blob;
|
||||||
console.log(this.videoSrc);
|
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