capacitor-plugin-vonage 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/managemyhealth/plugin/vonage/VideoCallActivity.java +47 -48
- package/android/src/main/java/com/managemyhealth/plugin/vonage/vonagePlugin.java +2 -0
- package/ios/Plugin/VideoChatViewController.swift +22 -12
- package/ios/Plugin/vonagePlugin.swift +2 -1
- package/package.json +1 -1
@@ -51,6 +51,7 @@ import pub.devrel.easypermissions.EasyPermissions;
|
|
51
51
|
public class VideoCallActivity extends AppCompatActivity implements EasyPermissions.PermissionCallbacks, Application.ActivityLifecycleCallbacks {
|
52
52
|
private static final String TAG = VideoCallActivity.class.getSimpleName();
|
53
53
|
private static Toast GlobalToast;
|
54
|
+
// public Integer streamCount =0;
|
54
55
|
public Session session;
|
55
56
|
private static Bridge staticBridge = null;
|
56
57
|
private String dummyProfile = "https://www.gravatar.com/avatar/?d=mp";
|
@@ -61,6 +62,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
61
62
|
String PUBLISHERNAME;
|
62
63
|
String profilePicApiUrl;
|
63
64
|
boolean isPatientOnline = false;
|
65
|
+
boolean enableVCConfig = false;
|
64
66
|
boolean isMuted = false;
|
65
67
|
boolean isCamOff = false;
|
66
68
|
public boolean temptest = false;
|
@@ -371,6 +373,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
371
373
|
PUBLISHERNAME = intent.getStringExtra("publisherName");
|
372
374
|
profilePicApiUrl = intent.getStringExtra("profilePicApiUrl");
|
373
375
|
isPatientOnline = intent.getBooleanExtra("isPatientOnline",false);
|
376
|
+
enableVCConfig = intent.getBooleanExtra("enableVCConfig",false);
|
374
377
|
ISPROVIDER = intent.getBooleanExtra("isProvider",false);
|
375
378
|
publisherViewContainer = findViewById(R.id.publisher_container);
|
376
379
|
subscriberViewContainer = findViewById(R.id.subscriber_container);
|
@@ -379,20 +382,27 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
379
382
|
publisherNameTextView = findViewById(R.id.publisherName);
|
380
383
|
publishernameView = findViewById(R.id.publisherNameView);
|
381
384
|
TextView subscriberNameTextView = findViewById(R.id.subscriberName);
|
382
|
-
if(
|
383
|
-
if (
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
385
|
+
if(enableVCConfig){
|
386
|
+
if (ISPROVIDER) {
|
387
|
+
if (isPatientOnline) {
|
388
|
+
patientStatus.setText("WAITING");
|
389
|
+
sendNotifications.setVisibility(View.GONE);
|
390
|
+
admit.setVisibility(View.VISIBLE);
|
391
|
+
deny.setVisibility(View.VISIBLE);
|
392
|
+
patientStatus.setBackgroundColor(getResources().getColor(R.color.waiting));
|
393
|
+
} else {
|
394
|
+
admit.setVisibility(View.GONE);
|
395
|
+
deny.setVisibility(View.GONE);
|
396
|
+
sendNotifications.setVisibility(View.VISIBLE);
|
397
|
+
patientStatus.setText("OFFLINE");
|
398
|
+
patientStatus.setBackgroundColor(getResources().getColor(R.color.offline));
|
399
|
+
}
|
395
400
|
}
|
401
|
+
}else{
|
402
|
+
admit.setVisibility(View.GONE);
|
403
|
+
deny.setVisibility(View.GONE);
|
404
|
+
sendNotifications.setVisibility(View.GONE);
|
405
|
+
patientStatus.setVisibility(View.GONE);
|
396
406
|
}
|
397
407
|
publisherNameTextView.setText(SUBSCRIBERNAME);
|
398
408
|
publishernameView.setText(SUBSCRIBERNAME);
|
@@ -579,45 +589,34 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
|
|
579
589
|
}
|
580
590
|
}
|
581
591
|
public void patientStatusChanged(Boolean isOnline) {
|
582
|
-
Log.d("patientStatusChanged", String.valueOf(isOnline));
|
583
|
-
Log.d("patientStatusChanged2", String.valueOf(isOnline));
|
584
|
-
Log.d("patientStatusChanged2", String.valueOf(isOnline));
|
585
|
-
Log.d("patientStatusChanged2", String.valueOf(instance.ISPROVIDER));
|
586
|
-
|
587
|
-
// if(instance.ISPROVIDER){
|
588
|
-
Log.d("patientStatuISPROVIDER", String.valueOf(isOnline));
|
589
|
-
|
590
|
-
if(subscriber==null){
|
591
|
-
runOnUiThread(new Runnable() {
|
592
|
-
@Override
|
593
|
-
public void run() {
|
594
|
-
temptest = isOnline;
|
595
|
-
if (isOnline) {
|
596
|
-
Log.d("isOnline", String.valueOf(isOnline));
|
597
592
|
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
593
|
+
if(enableVCConfig) {
|
594
|
+
if (subscriber == null) {
|
595
|
+
runOnUiThread(new Runnable() {
|
596
|
+
@Override
|
597
|
+
public void run() {
|
598
|
+
temptest = isOnline;
|
599
|
+
if (isOnline) {
|
600
|
+
patientStatus.setText("WAITING");
|
601
|
+
sendNotifications.setVisibility(View.GONE);
|
602
|
+
admit.setVisibility(View.VISIBLE);
|
603
|
+
deny.setVisibility(View.VISIBLE);
|
604
|
+
publishernameView.setVisibility(View.VISIBLE);
|
605
|
+
patientStatus.setBackgroundResource(R.color.waiting);
|
606
|
+
} else {
|
607
|
+
patientStatus.setText("OFFLINE");
|
608
|
+
admit.setVisibility(View.GONE);
|
609
|
+
deny.setVisibility(View.GONE);
|
610
|
+
publishernameView.setVisibility(View.VISIBLE);
|
611
|
+
sendNotifications.setVisibility(View.VISIBLE);
|
612
|
+
patientStatus.setText("OFFLINE");
|
613
|
+
patientStatus.setBackgroundResource(R.color.offline);
|
614
|
+
}
|
614
615
|
}
|
616
|
+
});
|
617
|
+
}
|
615
618
|
|
616
|
-
|
617
|
-
}
|
618
|
-
});
|
619
619
|
}
|
620
|
-
// }
|
621
620
|
}
|
622
621
|
public static void showGreenToast(Context context, String message) {
|
623
622
|
if(GlobalToast!=null){
|
@@ -128,6 +128,7 @@ public class vonagePlugin extends Plugin{
|
|
128
128
|
final String SUBSCRIBERNAME = call.getString("subscriberName");
|
129
129
|
final Boolean ISPROVIDER = call.getBoolean("isProvider");
|
130
130
|
final Boolean isPatientOnline = call.getBoolean("isPatientOnline");
|
131
|
+
final Boolean enableVCConfig = call.getBoolean("enableVCConfig");
|
131
132
|
final String profilePicApiUrl = call.getString("profilePhoto");
|
132
133
|
showLog("profilePicApiUrl");
|
133
134
|
showLog(profilePicApiUrl);
|
@@ -142,6 +143,7 @@ public class vonagePlugin extends Plugin{
|
|
142
143
|
intent.putExtra("isProvider", ISPROVIDER);
|
143
144
|
intent.putExtra("isPatientOnline", isPatientOnline);
|
144
145
|
intent.putExtra("profilePicApiUrl", profilePicApiUrl);
|
146
|
+
intent.putExtra("enableVCConfig", enableVCConfig);
|
145
147
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP);//|Intent.FLAG_ACTIVITY_NEW_TASK
|
146
148
|
try {
|
147
149
|
showLog("try======");
|
@@ -25,6 +25,7 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
25
25
|
var isPatientOnLine = true
|
26
26
|
var isPatientFromWeb = true
|
27
27
|
var videoCallParam = String()
|
28
|
+
var enableVCConfig = false
|
28
29
|
var profilePicApiUrl = ""
|
29
30
|
// var session: OTSession?
|
30
31
|
//var publisher: OTPublisher?
|
@@ -168,7 +169,10 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
168
169
|
isPatientOnLine = false
|
169
170
|
}
|
170
171
|
DispatchQueue.main.async {
|
171
|
-
self.
|
172
|
+
if(self.enableVCConfig){
|
173
|
+
self.patientStatusChanged()
|
174
|
+
}
|
175
|
+
|
172
176
|
}
|
173
177
|
|
174
178
|
// }
|
@@ -333,7 +337,11 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
333
337
|
centerView.addSubview(subscriberNameLabel)
|
334
338
|
centerView.addSubview(sendNotificationBtn)
|
335
339
|
//patientStatusChanged()
|
336
|
-
centerView.isHidden =
|
340
|
+
centerView.isHidden = false
|
341
|
+
adminBtn.isHidden = true
|
342
|
+
denyBtn.isHidden = true
|
343
|
+
sendNotificationBtn.isHidden = true
|
344
|
+
subscriberStatusLabel.isHidden = true
|
337
345
|
|
338
346
|
// subscriberImg = UIImageView(image: <#T##UIImage?#>)
|
339
347
|
//remoteView.addSubview(centerView)
|
@@ -572,7 +580,9 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
572
580
|
localView.addSubview(publisherView)
|
573
581
|
startTimer()
|
574
582
|
DispatchQueue.main.async {
|
575
|
-
self.
|
583
|
+
if(self.enableVCConfig){
|
584
|
+
self.patientStatusChanged()
|
585
|
+
}
|
576
586
|
}
|
577
587
|
|
578
588
|
}
|
@@ -672,15 +682,15 @@ class VideoChatViewController: UIViewController,OTSessionDelegate,OTPublisherDel
|
|
672
682
|
|
673
683
|
|
674
684
|
}
|
675
|
-
func sessionDidBeginReconnecting(_ session:OTSession) {
|
676
|
-
// Display a user interface notification.
|
677
|
-
print("sessionDidBeginReconnecting \(session.sessionId)")
|
678
|
-
}
|
679
|
-
|
680
|
-
func sessionDidReconnect(_ session: OTSession) {
|
681
|
-
// Adjust user interface.
|
682
|
-
print("sessionDidReconnect \(session.sessionId)")
|
683
|
-
}
|
685
|
+
// func sessionDidBeginReconnecting(_ session:OTSession) {
|
686
|
+
// // Display a user interface notification.
|
687
|
+
// print("sessionDidBeginReconnecting \(session.sessionId)")
|
688
|
+
// }
|
689
|
+
//
|
690
|
+
// func sessionDidReconnect(_ session: OTSession) {
|
691
|
+
// // Adjust user interface.
|
692
|
+
// print("sessionDidReconnect \(session.sessionId)")
|
693
|
+
// }
|
684
694
|
//Publisher methods
|
685
695
|
func publisher(_ publisher: OTPublisherKit, didFailWithError error: OTError) {
|
686
696
|
print("The publisher failed: \(error)")
|
@@ -17,6 +17,7 @@ public class vonagePlugin: CAPPlugin,VonageSDKInteractionDelegate {
|
|
17
17
|
let isProvider = call.getBool("isProvider") ?? false //profilePicApiUrl
|
18
18
|
let isPatientOnline = call.getBool("isPatientOnline") ?? false
|
19
19
|
let profilePhoto = call.getString("profilePhoto") ?? ""
|
20
|
+
let enableVCConfig = call.getBool("enableVCConfig") ?? false
|
20
21
|
DispatchQueue.main.async {
|
21
22
|
let vc = VideoChatViewController()
|
22
23
|
vc.kApiKey = apiKey
|
@@ -27,7 +28,7 @@ public class vonagePlugin: CAPPlugin,VonageSDKInteractionDelegate {
|
|
27
28
|
vc.isProvider = isProvider
|
28
29
|
vc.isPatientOnLine = isPatientOnline
|
29
30
|
vc.profilePicApiUrl = profilePhoto
|
30
|
-
|
31
|
+
vc.enableVCConfig = enableVCConfig
|
31
32
|
vc.modalPresentationStyle = .fullScreen
|
32
33
|
vc.delegate = self
|
33
34
|
self.bridge?.viewController?.present(vc, animated: true, completion: nil)
|