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

View File

@ -45,7 +45,6 @@ export class ChatComponentComponent implements OnInit {
cusUrl: string = '';
private renderer: Renderer2;
cm_name: string;
pd_category: string;
constructor(
private router: Router,
private route: ActivatedRoute,
@ -54,8 +53,6 @@ export class ChatComponentComponent implements OnInit {
this.renderer = rendererFactory.createRenderer(null, null)
this.randomStr = this.route.snapshot.paramMap.get('randomStr')
// 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.pd_id = this.route.snapshot.paramMap.get('id')
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'
if(this.type == '2' || this.type == '3') {
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{
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.cusUrl = window.location.origin+'/vchat/#/chat/'+this.randomStr+";id="+this.pd_id+";type=1;";
}
}
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)
// navigator.getUserMedia({ audio: true, video: true }, function (stream) {
@ -147,10 +141,7 @@ export class ChatComponentComponent implements OnInit {
this.twilioService.localVideo = this.localVideo;
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}
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);
}

View File

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