Fairoj : Playback button is enabled after the pd is completed

This commit is contained in:
venbatechnologies@gmail.com 2020-06-12 19:00:27 +05:30
parent d602d11346
commit b441cb8814
3 changed files with 15 additions and 7 deletions

View File

@ -146,10 +146,12 @@
</button>&nbsp;&nbsp;</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>&nbsp;
<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>&nbsp;
<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>&nbsp;
<strong>Call</strong>

View File

@ -86,4 +86,7 @@
// right: 415px;
}
// }
}
.mat-tooltip{
font-size: 12px !important;
}

View File

@ -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'];
})
}