Fairoj : video call alert hided and playback icon added in qc module
This commit is contained in:
parent
5e13d1cd6b
commit
4d54e2ae49
@ -146,6 +146,12 @@
|
||||
<mat-icon>collections</mat-icon>
|
||||
<strong>Customer Images</strong>
|
||||
</button>
|
||||
<!-- <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' || master.fk_pd_type == '2'" mat-stroked-button matTooltip="Play Recorded Video" matTooltipPosition="above" 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 mat-raised-button class="mr-1 mb-1" color="primary" style="cursor: not-allowed !important;">
|
||||
<strong> {{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Addon Pending' : master.pd_status | titlecase}}</strong>
|
||||
</button>
|
||||
|
||||
@ -20,6 +20,7 @@ import {DatePipe } from '@angular/common';
|
||||
import { VendorPdAllocationComponent } from 'app/personal-discussion/manage-pd/list-pd/vendor-pd-allocation/VendorPdAllocationComponent';
|
||||
import { QcCusImagesComponent } from 'app/quality-check/qc-cus-images/qc-cus-images.component';
|
||||
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
|
||||
import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-qc-view',
|
||||
@ -60,6 +61,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
public _EditPDtriggerForm:FormGroup;
|
||||
pdCollectedDocument:any=[];
|
||||
pd_QC_Rating: Number;
|
||||
videoplayback: any = {enableBtn:false,url:null};
|
||||
constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder,
|
||||
private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent,private pdService:PdTrigerService) {
|
||||
this.notifier=notifier
|
||||
@ -82,6 +84,10 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
if (data.status == 200) {
|
||||
let masterData: any = data.records.pd_master_details;
|
||||
this.pdMasterData.push(masterData[0]);
|
||||
if((this.pdMasterData[0].fk_pd_type == '3' || this.pdMasterData[0].fk_pd_type == '2') && (this.pdMasterData[0].pd_status == 'COMPLETED' || this.pdMasterData[0].pd_status == 'QC_COMPLETED')) {
|
||||
this.getVideoUrl(this.viewID,this.masterRandomString)
|
||||
this.videoplayback.enableBtn = true;
|
||||
}
|
||||
this.reportRandomString = btoa(masterData[0].random_string);
|
||||
let parent_pd_id=masterData[0].parent_pd_id
|
||||
localStorage.setItem('parent_pd_id_for_Genie',parent_pd_id);
|
||||
@ -354,6 +360,27 @@ export class QcViewComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
})
|
||||
}
|
||||
openPlayer(){
|
||||
if(this.videoplayback.url == null) {
|
||||
this.notifier.notify('info',"No Videos Found");
|
||||
return;
|
||||
}
|
||||
let dialogRef = this.dialog.open(VideoPlayerComponent,{
|
||||
data:{videoUrl:this.videoplayback.url},
|
||||
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.pdService.getRecordedPlaybackUrl(params).subscribe(result=>{
|
||||
this.videoplayback.url=result['url'];
|
||||
})
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
if(this.destroyType==1){
|
||||
this.QcListComponent.pdListLoad(true);
|
||||
|
||||
@ -177,7 +177,7 @@ export class VideoChatComponent implements OnInit {
|
||||
peerx.on('error', (err) => {
|
||||
console.log("Fatal Error ",err);
|
||||
this.disconnect();
|
||||
alert("Fatal Error" +JSON.stringify(err))
|
||||
// alert("Fatal Error" +JSON.stringify(err))
|
||||
})
|
||||
peerx.on('stream', (stream)=> {
|
||||
console.log("@##################33",stream)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user