Compare commits
10 Commits
0668f61fe0
...
263f0f08dd
| Author | SHA1 | Date | |
|---|---|---|---|
| 263f0f08dd | |||
|
|
f7e108f9ca | ||
|
|
d26df4f1a4 | ||
|
|
fc3ec32121 | ||
|
|
f733ffb4f6 | ||
|
|
11c4fa11e2 | ||
|
|
1cbb5b036e | ||
|
|
f93f5f7292 | ||
|
|
84378a14dd | ||
|
|
35b44f3af4 |
BIN
Sparq_video_chat(26-10-2021).zip
Normal file
BIN
Sparq_video_chat(26-10-2021).zip
Normal file
Binary file not shown.
@ -183,12 +183,15 @@ body{
|
||||
// "A B"
|
||||
// "C C";
|
||||
grid-template-areas:
|
||||
"A B";
|
||||
"A B C";
|
||||
// "B C";
|
||||
//height:50%;
|
||||
//width:100%;
|
||||
::ng-deep .my-video{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
height:145px;
|
||||
width: 140px;
|
||||
height:50%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -197,7 +200,18 @@ body{
|
||||
grid-template-rows: $two-rows;
|
||||
grid-template-areas:
|
||||
"A B"
|
||||
"C D";
|
||||
"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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.grid--5 {
|
||||
@ -262,19 +276,21 @@ body{
|
||||
}
|
||||
|
||||
::ng-deep .video-wrapper {
|
||||
background-color: black;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
padding: 2px;
|
||||
padding: 20px;
|
||||
.identity-name {
|
||||
position: relative;
|
||||
background-color: #b1b1b1;
|
||||
background-color: #0f0f0f;
|
||||
text-align: center;
|
||||
opacity: 0.8;
|
||||
padding: 0;
|
||||
bottom: 39px;
|
||||
left: 0%;
|
||||
.praticipant-name {
|
||||
color:white;
|
||||
// width: 80%;
|
||||
margin-left: 30px;
|
||||
margin-right: 30px;
|
||||
|
||||
@ -45,6 +45,7 @@ export class ChatComponentComponent implements OnInit {
|
||||
cusUrl: string = '';
|
||||
private renderer: Renderer2;
|
||||
cm_name: string;
|
||||
pd_category: string;
|
||||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
@ -53,6 +54,8 @@ 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')
|
||||
@ -74,6 +77,9 @@ export class ChatComponentComponent implements OnInit {
|
||||
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.username = this.route.snapshot.paramMap.get('name')
|
||||
if (this.username == null) {
|
||||
@ -94,7 +100,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) {
|
||||
|
||||
@ -141,7 +147,10 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@ 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)=>{
|
||||
@ -136,21 +137,29 @@ export class TwilioService {
|
||||
|
||||
|
||||
});
|
||||
|
||||
console.log(this.getWithOutCustomer);
|
||||
let withoutcustomer = this.getWithOutCustomer(this.roomParticipants)
|
||||
console.log('getWithOutCustomer',withoutcustomer)
|
||||
alert(this.user_data.type);
|
||||
alert(withoutcustomer);
|
||||
if((this.user_data.type == '2'|| this.user_data.type == '1') && (withoutcustomer == '1')) {
|
||||
|
||||
|
||||
if((this.user_data.type == '1' && withoutcustomer == '1') ||(this.user_data.type == '2' && 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)
|
||||
this.sendRoomandStatus(params).subscribe(rr=>{})
|
||||
}
|
||||
else if(this.user_data.type == '3' && withoutcustomer == '0'){
|
||||
|
||||
else if(this.user_data.type == '3' && 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"}
|
||||
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=>{})
|
||||
}
|
||||
@ -307,9 +316,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
|
||||
}
|
||||
@ -542,13 +551,19 @@ 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"}
|
||||
console.log("disconnected api",params)
|
||||
if(this.user_data.pd_category == '2'){
|
||||
params["pd_category"] = this.user_data.pd_category;
|
||||
}
|
||||
console.log("disconnected Fns in twilioservice t2 ",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"}
|
||||
console.log("disconnected api",params)
|
||||
if(this.user_data.pd_category == '2'){
|
||||
params["pd_category"] = this.user_data.pd_category;
|
||||
}
|
||||
console.log("disconnected Fns in twilioservice t3 ",params);
|
||||
this.sendRoomandStatus(params).subscribe(rr=>{})
|
||||
}
|
||||
this.roomObj.disconnect();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user