Fairoj : video call alert hided and playback icon added in qc module

This commit is contained in:
venbatechnologies@gmail.com 2020-08-07 17:00:04 +05:30
parent 5e13d1cd6b
commit 4d54e2ae49
3 changed files with 34 additions and 1 deletions

View File

@ -146,6 +146,12 @@
<mat-icon>collections</mat-icon>&nbsp; <mat-icon>collections</mat-icon>&nbsp;
<strong>Customer Images</strong> <strong>Customer Images</strong>
</button> </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>&nbsp;
<strong>Play</strong>
</button>
<!-- </span> -->
<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;">
<strong> {{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Addon Pending' : master.pd_status | titlecase}}</strong> <strong> {{master.pd_status==pdStatusCheck.QC_COMPLETED ? 'QC Completed' : master.pd_status==pdStatusCheck.ADD_ON_PENDING ? 'Addon Pending' : master.pd_status | titlecase}}</strong>
</button> </button>

View File

@ -20,6 +20,7 @@ import {DatePipe } from '@angular/common';
import { VendorPdAllocationComponent } from 'app/personal-discussion/manage-pd/list-pd/vendor-pd-allocation/VendorPdAllocationComponent'; 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 { QcCusImagesComponent } from 'app/quality-check/qc-cus-images/qc-cus-images.component';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service'; import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component';
@Component({ @Component({
selector: 'app-qc-view', selector: 'app-qc-view',
@ -60,6 +61,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
public _EditPDtriggerForm:FormGroup; public _EditPDtriggerForm:FormGroup;
pdCollectedDocument:any=[]; pdCollectedDocument:any=[];
pd_QC_Rating: Number; pd_QC_Rating: Number;
videoplayback: any = {enableBtn:false,url:null};
constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder, constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder,
private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent,private pdService:PdTrigerService) { private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent,private pdService:PdTrigerService) {
this.notifier=notifier this.notifier=notifier
@ -82,6 +84,10 @@ export class QcViewComponent implements OnInit, OnDestroy {
if (data.status == 200) { if (data.status == 200) {
let masterData: any = data.records.pd_master_details; let masterData: any = data.records.pd_master_details;
this.pdMasterData.push(masterData[0]); 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); this.reportRandomString = btoa(masterData[0].random_string);
let parent_pd_id=masterData[0].parent_pd_id let parent_pd_id=masterData[0].parent_pd_id
localStorage.setItem('parent_pd_id_for_Genie',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 { ngOnDestroy(): void {
if(this.destroyType==1){ if(this.destroyType==1){
this.QcListComponent.pdListLoad(true); this.QcListComponent.pdListLoad(true);

View File

@ -177,7 +177,7 @@ export class VideoChatComponent implements OnInit {
peerx.on('error', (err) => { peerx.on('error', (err) => {
console.log("Fatal Error ",err); console.log("Fatal Error ",err);
this.disconnect(); this.disconnect();
alert("Fatal Error" +JSON.stringify(err)) // alert("Fatal Error" +JSON.stringify(err))
}) })
peerx.on('stream', (stream)=> { peerx.on('stream', (stream)=> {
console.log("@##################33",stream) console.log("@##################33",stream)