Fairoj : Playback button is enabled after the pd is completed
This commit is contained in:
parent
d602d11346
commit
b441cb8814
@ -146,10 +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>
|
||||
<span matTooltip="{{!videoplayback.enableBtn ? 'Recorded video is available after the PD is completed' : 'Play Recorded Video'}}" matTooltipPosition="above">
|
||||
<button *ngIf="master.fk_pd_type == '3'" mat-stroked-button class="mr-1 mb-1" color="primary" (click)="openPlayer()" [disabled]="!videoplayback.enableBtn" >
|
||||
<mat-icon>play_circle_filled</mat-icon>
|
||||
<strong>Play</strong>
|
||||
</button>
|
||||
</span>
|
||||
<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>
|
||||
<strong>Call</strong>
|
||||
|
||||
@ -86,4 +86,7 @@
|
||||
// right: 415px;
|
||||
}
|
||||
// }
|
||||
}
|
||||
.mat-tooltip{
|
||||
font-size: 12px !important;
|
||||
}
|
||||
@ -127,7 +127,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
// }
|
||||
]
|
||||
};
|
||||
videoSrc: any = null;
|
||||
videoplayback: any = {enableBtn:false,url:null};
|
||||
|
||||
constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder,
|
||||
private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent) {
|
||||
@ -147,7 +147,6 @@ 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;
|
||||
|
||||
@ -162,6 +161,10 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
if (data.status == 200) {
|
||||
let masterData: any = data.records.pd_master_details;
|
||||
this.pdMasterData.push(masterData[0]);
|
||||
if(this.pdMasterData[0].pd_status == 'COMPLETED') {
|
||||
this.getVideoUrl(this.viewID,this.masterRandomString)
|
||||
this.videoplayback.enableBtn = true;
|
||||
}
|
||||
this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
|
||||
this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
|
||||
this.pdApplicantData = data.records.applicants_details;
|
||||
@ -631,12 +634,12 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
})
|
||||
}
|
||||
openPlayer(){
|
||||
if(this.videoSrc == null) {
|
||||
if(this.videoplayback.url == null) {
|
||||
this.notifier.notify('info',"No Videos Found");
|
||||
return;
|
||||
}
|
||||
let dialogRef = this.dialog.open(VideoPlayerComponent,{
|
||||
data:{videoUrl:this.videoSrc},
|
||||
data:{videoUrl:this.videoplayback.url},
|
||||
maxWidth: '100vw',
|
||||
maxHeight: '100vh',
|
||||
height: '80%',
|
||||
@ -648,7 +651,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
getVideoUrl(pd_id,randomStr){
|
||||
let params = {"pd_id":pd_id,"random_string":randomStr}
|
||||
this._pd.getRecordedPlaybackUrl(params).subscribe(result=>{
|
||||
this.videoSrc=result['url'];
|
||||
this.videoplayback.url=result['url'];
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user