Compare commits

..

No commits in common. "263f0f08ddec22bcf472b6e9b279224452f13c87" and "0668f61fe01868844113f476cfd6a467a714ddd6" have entirely different histories.

4 changed files with 23 additions and 63 deletions

Binary file not shown.

View File

@ -183,15 +183,12 @@ body{
// "A B" // "A B"
// "C C"; // "C C";
grid-template-areas: grid-template-areas:
"A B C"; "A B";
// "B C";
//height:50%;
//width:100%;
::ng-deep .my-video{ ::ng-deep .my-video{
position: absolute; position: absolute;
top: 0; top: 0;
height:50%; height:145px;
width: 100%; width: 140px;
} }
} }
} }
@ -200,18 +197,7 @@ body{
grid-template-rows: $two-rows; grid-template-rows: $two-rows;
grid-template-areas: grid-template-areas:
"A B" "A B"
"A C" "C D";
"A D";
background-color: #0f0f0f;
padding-left: 150px;
padding-right: 150px;
height:50%;
width:100%;
@media (orientation: portrait) {
padding-left:0px;
padding-right:0px;
}
} }
.grid--5 { .grid--5 {
@ -276,21 +262,19 @@ body{
} }
::ng-deep .video-wrapper { ::ng-deep .video-wrapper {
background-color: black;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
width: 100%; width: 100%;
padding: 20px; padding: 2px;
.identity-name { .identity-name {
position: relative; position: relative;
background-color: #0f0f0f; background-color: #b1b1b1;
text-align: center; text-align: center;
opacity: 0.8; opacity: 0.8;
padding: 0; padding: 0;
bottom: 39px; bottom: 39px;
left: 0%; left: 0%;
.praticipant-name { .praticipant-name {
color:white;
// width: 80%; // width: 80%;
margin-left: 30px; margin-left: 30px;
margin-right: 30px; margin-right: 30px;

View File

@ -45,7 +45,6 @@ export class ChatComponentComponent implements OnInit {
cusUrl: string = ''; cusUrl: string = '';
private renderer: Renderer2; private renderer: Renderer2;
cm_name: string; cm_name: string;
pd_category: string;
constructor( constructor(
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
@ -54,8 +53,6 @@ export class ChatComponentComponent implements OnInit {
this.renderer = rendererFactory.createRenderer(null, null) this.renderer = rendererFactory.createRenderer(null, null)
this.randomStr = this.route.snapshot.paramMap.get('randomStr') this.randomStr = this.route.snapshot.paramMap.get('randomStr')
// this.flag= this.route.snapshot.paramMap.get('flag'); // this.flag= this.route.snapshot.paramMap.get('flag');
this.pd_category = this.route.snapshot.paramMap.get('pd_category')
console.log("pd category in compnt ",this.pd_category);
this.type = this.route.snapshot.paramMap.get('type') this.type = this.route.snapshot.paramMap.get('type')
this.pd_id = this.route.snapshot.paramMap.get('id') this.pd_id = this.route.snapshot.paramMap.get('id')
this.cm_name = this.route.snapshot.paramMap.get('uid') this.cm_name = this.route.snapshot.paramMap.get('uid')
@ -72,13 +69,10 @@ export class ChatComponentComponent implements OnInit {
this.type_name = this.type == '1' ? 'CUSTOMER' : this.type == '2' ? 'PDOFFICER' : this.type == '3' ? this.cm_name : 'UNKNOWN' this.type_name = this.type == '1' ? 'CUSTOMER' : this.type == '2' ? 'PDOFFICER' : this.type == '3' ? this.cm_name : 'UNKNOWN'
if(this.type == '2' || this.type == '3') { if(this.type == '2' || this.type == '3') {
if(window.location.origin.includes('localhost')){ if(window.location.origin.includes('localhost')){
this.cusUrl = window.location.origin+'/#/chat/'+this.randomStr+";id="+this.pd_id+";type=1;"; this.cusUrl = window.location.origin+'/#/chat/'+this.randomStr+";id="+this.pd_id+";type=1;";
} }
else{ else{
this.cusUrl = window.location.origin+'/vchat/#/chat/'+this.randomStr+";id="+this.pd_id+";type=1;"; this.cusUrl = window.location.origin+'/vchat/#/chat/'+this.randomStr+";id="+this.pd_id+";type=1;";
}
if(this.pd_category == '2'){
this.cusUrl = this.cusUrl+"pd_category=2";
} }
} }
this.username = this.route.snapshot.paramMap.get('name') this.username = this.route.snapshot.paramMap.get('name')
@ -100,7 +94,7 @@ export class ChatComponentComponent implements OnInit {
}) })
// console.log(navigator.getUserMedia) console.log(navigator.getUserMedia)
// if (navigator.getUserMedia) // if (navigator.getUserMedia)
// navigator.getUserMedia({ audio: true, video: true }, function (stream) { // navigator.getUserMedia({ audio: true, video: true }, function (stream) {
@ -147,10 +141,7 @@ export class ChatComponentComponent implements OnInit {
this.twilioService.localVideo = this.localVideo; this.twilioService.localVideo = this.localVideo;
this.twilioService.remoteVideo = this.remoteVideo; this.twilioService.remoteVideo = this.remoteVideo;
this.twilioService.user_data = {type:this.type,pd_id:this.pd_id,random_string:this.randomStr,type_name:this.type_name} this.twilioService.user_data = {type:this.type,pd_id:this.pd_id,random_string:this.randomStr,type_name:this.type_name}
if(this.pd_category == '2'){
this.twilioService.user_data['pd_category']=this.pd_category ;
}
// console.log(this.twilioService.user_data);
console.log("Getting token", this.twilioService.localVideo, this.localVideo, this.remoteVideo, this.type_name); console.log("Getting token", this.twilioService.localVideo, this.localVideo, this.remoteVideo, this.type_name);
} }

View File

@ -34,7 +34,6 @@ export class TwilioService {
private router: Router, private router: Router,
private rendererFactory: RendererFactory2,private _snackBar:MatSnackBar) { private rendererFactory: RendererFactory2,private _snackBar:MatSnackBar) {
this.renderer = rendererFactory.createRenderer(null, null); this.renderer = rendererFactory.createRenderer(null, null);
console.log("User Data From Component",this.user_data);
} }
getToken(params): Observable<any> { getToken(params): Observable<any> {
// return Observable.create((observer:any)=>{ // return Observable.create((observer:any)=>{
@ -137,30 +136,22 @@ export class TwilioService {
}); });
console.log(this.getWithOutCustomer);
let withoutcustomer = this.getWithOutCustomer(this.roomParticipants) let withoutcustomer = this.getWithOutCustomer(this.roomParticipants)
console.log('getWithOutCustomer',withoutcustomer) console.log('getWithOutCustomer',withoutcustomer)
alert(this.user_data.type);
alert(withoutcustomer);
if((this.user_data.type == '1' && withoutcustomer == '1') ||(this.user_data.type == '2' && withoutcustomer == '1')){ if((this.user_data.type == '2'|| this.user_data.type == '1') && (withoutcustomer == '1')) {
console.log("User type in service",this.user_data) console.log("User type in service",this.user_data)
let params = {"fk_pd_id":this.user_data.pd_id,"room_id":this.roomObj.sid,"is_call_ended":"0"} let params = {"fk_pd_id":this.user_data.pd_id,"room_id":this.roomObj.sid,"is_call_ended":"0"}
console.log(this.user_data.pd_category) console.log("connected api",params)
if(this.user_data.pd_category == '2'){
params["pd_category"] = this.user_data.pd_category;
}
console.log("connected api",params)
this.sendRoomandStatus(params).subscribe(rr=>{}) this.sendRoomandStatus(params).subscribe(rr=>{})
} }
else if(this.user_data.type == '3' && withoutcustomer == '1'){ else if(this.user_data.type == '3' && withoutcustomer == '0'){
console.log("User type in service",this.user_data) console.log("User type in service",this.user_data)
let params = {"fk_pd_id":this.user_data.pd_id,"room_id":this.roomObj.sid,"is_call_ended":"0"} let params = {"fk_pd_id":this.user_data.pd_id,"room_id":this.roomObj.sid,"is_call_ended":"0"}
if(this.user_data.pd_category == '2'){ console.log("connected api",params)
params["pd_category"] = this.user_data.pd_category;
}
console.log("connected api",params)
this.sendRoomandStatus(params).subscribe(rr=>{}) this.sendRoomandStatus(params).subscribe(rr=>{})
} }
// } // }
@ -316,9 +307,9 @@ export class TwilioService {
getWithOutCustomer(participant){ getWithOutCustomer(participant){
let participantWOC: any = [] let participantWOC: any = []
participant.forEach(element => { participant.forEach(element => {
//if(element.identity != 'CUSTOMER'){ if(element.identity != 'CUSTOMER'){
participantWOC.push(element) participantWOC.push(element)
// } }
}); });
return participantWOC.length return participantWOC.length
} }
@ -551,19 +542,13 @@ disconnect(){
console.log("User type in service",this.user_data,this.remoteVideo) console.log("User type in service",this.user_data,this.remoteVideo)
if(this.user_data.type == '2' && this.remoteVideo.nativeElement.firstChild != null) { if(this.user_data.type == '2' && this.remoteVideo.nativeElement.firstChild != null) {
let params = {"fk_pd_id":this.user_data.pd_id,"room_id":this.roomObj.sid,"is_call_ended":"1"} let params = {"fk_pd_id":this.user_data.pd_id,"room_id":this.roomObj.sid,"is_call_ended":"1"}
if(this.user_data.pd_category == '2'){ console.log("disconnected api",params)
params["pd_category"] = this.user_data.pd_category;
}
console.log("disconnected Fns in twilioservice t2 ",params);
this.sendRoomandStatus(params).subscribe(rr=>{}) this.sendRoomandStatus(params).subscribe(rr=>{})
} }
else if(this.user_data.type == '3' && withoutcustomer == '0'){ else if(this.user_data.type == '3' && withoutcustomer == '0'){
console.log("User type in service",this.user_data) console.log("User type in service",this.user_data)
let params = {"fk_pd_id":this.user_data.pd_id,"room_id":this.roomObj.sid,"is_call_ended":"1"} let params = {"fk_pd_id":this.user_data.pd_id,"room_id":this.roomObj.sid,"is_call_ended":"1"}
if(this.user_data.pd_category == '2'){ console.log("disconnected api",params)
params["pd_category"] = this.user_data.pd_category;
}
console.log("disconnected Fns in twilioservice t3 ",params);
this.sendRoomandStatus(params).subscribe(rr=>{}) this.sendRoomandStatus(params).subscribe(rr=>{})
} }
this.roomObj.disconnect(); this.roomObj.disconnect();