@capgo/capacitor-stream-call 0.0.64 → 0.0.66
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.
|
@@ -255,13 +255,6 @@ public class StreamCallPlugin : Plugin() {
|
|
|
255
255
|
android.util.Log.d("StreamCallPlugin", "New Intent - Extras: $extras")
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
// Public method to handle ACCEPT_CALL intent from MainActivity
|
|
259
|
-
@JvmOverloads
|
|
260
|
-
public fun handleAcceptCallIntent(intent: android.content.Intent) {
|
|
261
|
-
android.util.Log.d("StreamCallPlugin", "handleAcceptCallIntent called: action=${intent.action}")
|
|
262
|
-
handleOnNewIntent(intent)
|
|
263
|
-
}
|
|
264
|
-
|
|
265
258
|
@OptIn(DelicateCoroutinesApi::class)
|
|
266
259
|
private fun declineCall(call: Call) {
|
|
267
260
|
android.util.Log.d("StreamCallPlugin", "declineCall called for call: ${call.id}")
|
|
@@ -326,37 +319,64 @@ public class StreamCallPlugin : Plugin() {
|
|
|
326
319
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
327
320
|
ViewGroup.LayoutParams.MATCH_PARENT
|
|
328
321
|
)
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
322
|
+
}
|
|
323
|
+
parent.addView(overlayView, 0) // Add at index 0 to ensure it's below WebView
|
|
324
|
+
|
|
325
|
+
// Initialize with active call content
|
|
326
|
+
setOverlayContent()
|
|
327
|
+
|
|
328
|
+
// Create barrier view (above webview for blocking interaction during call setup)
|
|
329
|
+
barrierView = View(context).apply {
|
|
330
|
+
isVisible = false
|
|
331
|
+
layoutParams = FrameLayout.LayoutParams(
|
|
332
|
+
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
333
|
+
ViewGroup.LayoutParams.MATCH_PARENT
|
|
334
|
+
)
|
|
335
|
+
setBackgroundColor(Color.parseColor("#1a242c"))
|
|
336
|
+
}
|
|
337
|
+
parent.addView(barrierView, parent.indexOfChild(bridge?.webView) + 1) // Add above WebView
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Centralized function to set the overlay content with call UI.
|
|
342
|
+
* This handles all the common Compose UI setup for video calls.
|
|
343
|
+
*/
|
|
344
|
+
private fun setOverlayContent(call: Call? = null) {
|
|
345
|
+
overlayView?.setContent {
|
|
346
|
+
VideoTheme {
|
|
347
|
+
val activeCall = call ?: streamVideoClient?.state?.activeCall?.collectAsState()?.value
|
|
348
|
+
if (activeCall != null) {
|
|
349
|
+
val participants by activeCall.state.participants.collectAsStateWithLifecycle()
|
|
350
|
+
val sortedParticipants by activeCall.state.sortedParticipants.collectAsStateWithLifecycle(emptyList())
|
|
351
|
+
val callParticipants by remember(participants) {
|
|
352
|
+
derivedStateOf {
|
|
353
|
+
if (sortedParticipants.size > 6) {
|
|
354
|
+
sortedParticipants
|
|
355
|
+
} else {
|
|
356
|
+
participants
|
|
342
357
|
}
|
|
343
358
|
}
|
|
359
|
+
}
|
|
344
360
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
361
|
+
val currentLocal by activeCall.state.me.collectAsStateWithLifecycle()
|
|
362
|
+
|
|
363
|
+
CallContent(
|
|
364
|
+
call = activeCall,
|
|
365
|
+
onBackPressed = { /* Handle back press if needed */ },
|
|
366
|
+
controlsContent = { /* Empty to disable native controls */ },
|
|
367
|
+
appBarContent = { /* Empty to disable app bar with stop call button */ },
|
|
368
|
+
videoRenderer = { videoModifier, videoCall, videoParticipant, videoStyle ->
|
|
369
|
+
ParticipantVideo(
|
|
370
|
+
modifier = videoModifier,
|
|
371
|
+
call = videoCall,
|
|
372
|
+
participant = videoParticipant,
|
|
373
|
+
style = videoStyle,
|
|
374
|
+
actionsContent = {_, _, _ -> {}},
|
|
375
|
+
scalingType = VideoScalingType.SCALE_ASPECT_FIT
|
|
376
|
+
)
|
|
377
|
+
},
|
|
378
|
+
floatingVideoRenderer = { call, parentSize ->
|
|
379
|
+
currentLocal?.let {
|
|
360
380
|
FloatingParticipantVideo(
|
|
361
381
|
call = call,
|
|
362
382
|
participant = currentLocal!!,
|
|
@@ -368,30 +388,19 @@ public class StreamCallPlugin : Plugin() {
|
|
|
368
388
|
.fillMaxSize()
|
|
369
389
|
.clip(VideoTheme.shapes.dialog),
|
|
370
390
|
call = call,
|
|
371
|
-
participant =
|
|
391
|
+
participant = it,
|
|
372
392
|
style = RegularVideoRendererStyle().copy(isShowingConnectionQualityIndicator = false),
|
|
373
393
|
actionsContent = {_, _, _ -> {}},
|
|
374
394
|
)
|
|
375
395
|
}
|
|
376
396
|
)
|
|
377
397
|
}
|
|
378
|
-
|
|
379
|
-
|
|
398
|
+
|
|
399
|
+
}
|
|
400
|
+
)
|
|
380
401
|
}
|
|
381
402
|
}
|
|
382
403
|
}
|
|
383
|
-
parent.addView(overlayView, 0) // Add at index 0 to ensure it's below WebView
|
|
384
|
-
|
|
385
|
-
// Create barrier view (above webview for blocking interaction during call setup)
|
|
386
|
-
barrierView = View(context).apply {
|
|
387
|
-
isVisible = false
|
|
388
|
-
layoutParams = FrameLayout.LayoutParams(
|
|
389
|
-
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
390
|
-
ViewGroup.LayoutParams.MATCH_PARENT
|
|
391
|
-
)
|
|
392
|
-
setBackgroundColor(Color.parseColor("#1a242c"))
|
|
393
|
-
}
|
|
394
|
-
parent.addView(barrierView, parent.indexOfChild(bridge?.webView) + 1) // Add above WebView
|
|
395
404
|
}
|
|
396
405
|
|
|
397
406
|
@PluginMethod
|
|
@@ -1033,65 +1042,8 @@ public class StreamCallPlugin : Plugin() {
|
|
|
1033
1042
|
call.microphone?.setEnabled(true)
|
|
1034
1043
|
call.camera?.setEnabled(true)
|
|
1035
1044
|
android.util.Log.d("StreamCallPlugin", "internalAcceptCall: Microphone and camera enabled for call ${call.id}")
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
if (call != null) {
|
|
1039
|
-
android.util.Log.d("StreamCallPlugin", "internalAcceptCall: Setting CallContent with active call ${call.id}")
|
|
1040
|
-
|
|
1041
|
-
val participants by call.state.participants.collectAsStateWithLifecycle()
|
|
1042
|
-
val sortedParticipants by call.state.sortedParticipants.collectAsStateWithLifecycle(emptyList())
|
|
1043
|
-
val callParticipants by remember(participants) {
|
|
1044
|
-
derivedStateOf {
|
|
1045
|
-
if (sortedParticipants.size > 6) {
|
|
1046
|
-
sortedParticipants
|
|
1047
|
-
} else {
|
|
1048
|
-
participants
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
val currentLocal by call.state.me.collectAsStateWithLifecycle()
|
|
1054
|
-
|
|
1055
|
-
CallContent(
|
|
1056
|
-
call = call,
|
|
1057
|
-
onBackPressed = { /* ... */ },
|
|
1058
|
-
controlsContent = { /* ... */ },
|
|
1059
|
-
appBarContent = { /* ... */ },
|
|
1060
|
-
videoRenderer = { videoModifier, videoCall, videoParticipant, videoStyle ->
|
|
1061
|
-
ParticipantVideo(
|
|
1062
|
-
modifier = videoModifier,
|
|
1063
|
-
call = videoCall,
|
|
1064
|
-
participant = videoParticipant,
|
|
1065
|
-
style = videoStyle,
|
|
1066
|
-
actionsContent = {_, _, _ -> {}},
|
|
1067
|
-
scalingType = VideoScalingType.SCALE_ASPECT_FIT
|
|
1068
|
-
)
|
|
1069
|
-
},
|
|
1070
|
-
floatingVideoRenderer = { call, parentSize ->
|
|
1071
|
-
FloatingParticipantVideo(
|
|
1072
|
-
call = call,
|
|
1073
|
-
participant = currentLocal!!,
|
|
1074
|
-
style = RegularVideoRendererStyle().copy(isShowingConnectionQualityIndicator = false),
|
|
1075
|
-
parentBounds = parentSize,
|
|
1076
|
-
videoRenderer = { _ ->
|
|
1077
|
-
ParticipantVideo(
|
|
1078
|
-
modifier = Modifier
|
|
1079
|
-
.fillMaxSize()
|
|
1080
|
-
.clip(VideoTheme.shapes.dialog),
|
|
1081
|
-
call = call,
|
|
1082
|
-
participant = currentLocal!!,
|
|
1083
|
-
style = RegularVideoRendererStyle().copy(isShowingConnectionQualityIndicator = false),
|
|
1084
|
-
actionsContent = {_, _, _ ->},
|
|
1085
|
-
)
|
|
1086
|
-
}
|
|
1087
|
-
)
|
|
1088
|
-
}
|
|
1089
|
-
)
|
|
1090
|
-
} else {
|
|
1091
|
-
android.util.Log.w("StreamCallPlugin", "internalAcceptCall: Active call is null, cannot set CallContent for call ${call.id}")
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1045
|
+
android.util.Log.d("StreamCallPlugin", "internalAcceptCall: Setting CallContent with active call ${call.id}")
|
|
1046
|
+
setOverlayContent(call)
|
|
1095
1047
|
android.util.Log.d("StreamCallPlugin", "internalAcceptCall: Content set for overlayView for call ${call.id}")
|
|
1096
1048
|
overlayView?.isVisible = true
|
|
1097
1049
|
android.util.Log.d("StreamCallPlugin", "internalAcceptCall: OverlayView set to visible for call ${call.id}, isVisible: ${overlayView?.isVisible}")
|
|
@@ -1111,61 +1063,8 @@ public class StreamCallPlugin : Plugin() {
|
|
|
1111
1063
|
// Force refresh with active call from client
|
|
1112
1064
|
val activeCall = streamVideoClient?.state?.activeCall?.value
|
|
1113
1065
|
if (activeCall != null) {
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
android.util.Log.d("StreamCallPlugin", "internalAcceptCall: Force refreshing CallContent with active call ${activeCall.id}")
|
|
1117
|
-
|
|
1118
|
-
val participants by activeCall.state.participants.collectAsStateWithLifecycle()
|
|
1119
|
-
val sortedParticipants by activeCall.state.sortedParticipants.collectAsStateWithLifecycle(emptyList())
|
|
1120
|
-
val callParticipants by remember(participants) {
|
|
1121
|
-
derivedStateOf {
|
|
1122
|
-
if (sortedParticipants.size > 6) {
|
|
1123
|
-
sortedParticipants
|
|
1124
|
-
} else {
|
|
1125
|
-
participants
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
val currentLocal by activeCall.state.me.collectAsStateWithLifecycle()
|
|
1131
|
-
|
|
1132
|
-
CallContent(
|
|
1133
|
-
call = activeCall,
|
|
1134
|
-
onBackPressed = { /* ... */ },
|
|
1135
|
-
controlsContent = { /* ... */ },
|
|
1136
|
-
appBarContent = { /* ... */ },
|
|
1137
|
-
videoRenderer = { videoModifier, videoCall, videoParticipant, videoStyle ->
|
|
1138
|
-
ParticipantVideo(
|
|
1139
|
-
modifier = videoModifier,
|
|
1140
|
-
call = videoCall,
|
|
1141
|
-
participant = videoParticipant,
|
|
1142
|
-
style = videoStyle,
|
|
1143
|
-
actionsContent = {_, _, _ -> {}},
|
|
1144
|
-
scalingType = VideoScalingType.SCALE_ASPECT_FIT
|
|
1145
|
-
)
|
|
1146
|
-
},
|
|
1147
|
-
floatingVideoRenderer = { call, parentSize ->
|
|
1148
|
-
FloatingParticipantVideo(
|
|
1149
|
-
call = call,
|
|
1150
|
-
participant = currentLocal!!,
|
|
1151
|
-
style = RegularVideoRendererStyle().copy(isShowingConnectionQualityIndicator = false),
|
|
1152
|
-
parentBounds = parentSize,
|
|
1153
|
-
videoRenderer = { _ ->
|
|
1154
|
-
ParticipantVideo(
|
|
1155
|
-
modifier = Modifier
|
|
1156
|
-
.fillMaxSize()
|
|
1157
|
-
.clip(VideoTheme.shapes.dialog),
|
|
1158
|
-
call = call,
|
|
1159
|
-
participant = currentLocal!!,
|
|
1160
|
-
style = RegularVideoRendererStyle().copy(isShowingConnectionQualityIndicator = false),
|
|
1161
|
-
actionsContent = {_, _, _ -> {}},
|
|
1162
|
-
)
|
|
1163
|
-
}
|
|
1164
|
-
)
|
|
1165
|
-
}
|
|
1166
|
-
)
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1066
|
+
android.util.Log.d("StreamCallPlugin", "internalAcceptCall: Force refreshing CallContent with active call ${activeCall.id}")
|
|
1067
|
+
setOverlayContent(activeCall)
|
|
1169
1068
|
android.util.Log.d("StreamCallPlugin", "internalAcceptCall: Content force refreshed for call ${activeCall.id}")
|
|
1170
1069
|
} else {
|
|
1171
1070
|
android.util.Log.w("StreamCallPlugin", "internalAcceptCall: Active call is null during force refresh for call ${call.id}")
|
|
@@ -1424,59 +1323,7 @@ public class StreamCallPlugin : Plugin() {
|
|
|
1424
1323
|
return@runOnMainThread
|
|
1425
1324
|
}
|
|
1426
1325
|
|
|
1427
|
-
|
|
1428
|
-
VideoTheme {
|
|
1429
|
-
val participants by call.state.participants.collectAsStateWithLifecycle()
|
|
1430
|
-
val sortedParticipants by call.state.sortedParticipants.collectAsStateWithLifecycle(emptyList())
|
|
1431
|
-
val callParticipants by remember(participants) {
|
|
1432
|
-
derivedStateOf {
|
|
1433
|
-
if (sortedParticipants.size > 6) {
|
|
1434
|
-
sortedParticipants
|
|
1435
|
-
} else {
|
|
1436
|
-
participants
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
val currentLocal by call.state.me.collectAsStateWithLifecycle()
|
|
1442
|
-
|
|
1443
|
-
CallContent(
|
|
1444
|
-
call = call,
|
|
1445
|
-
onBackPressed = { /* Handle back press if needed */ },
|
|
1446
|
-
controlsContent = { /* Empty to disable native controls */ },
|
|
1447
|
-
appBarContent = { /* Empty to disable app bar with stop call button */ },
|
|
1448
|
-
videoRenderer = { videoModifier, videoCall, videoParticipant, videoStyle ->
|
|
1449
|
-
ParticipantVideo(
|
|
1450
|
-
modifier = videoModifier,
|
|
1451
|
-
call = videoCall,
|
|
1452
|
-
participant = videoParticipant,
|
|
1453
|
-
style = videoStyle,
|
|
1454
|
-
actionsContent = {_, _, _ -> {}},
|
|
1455
|
-
scalingType = VideoScalingType.SCALE_ASPECT_FIT
|
|
1456
|
-
)
|
|
1457
|
-
},
|
|
1458
|
-
floatingVideoRenderer = { call, parentSize ->
|
|
1459
|
-
FloatingParticipantVideo(
|
|
1460
|
-
call = call,
|
|
1461
|
-
participant = currentLocal!!,
|
|
1462
|
-
style = RegularVideoRendererStyle().copy(isShowingConnectionQualityIndicator = false),
|
|
1463
|
-
parentBounds = parentSize,
|
|
1464
|
-
videoRenderer = { _ ->
|
|
1465
|
-
ParticipantVideo(
|
|
1466
|
-
modifier = Modifier
|
|
1467
|
-
.fillMaxSize()
|
|
1468
|
-
.clip(VideoTheme.shapes.dialog),
|
|
1469
|
-
call = call,
|
|
1470
|
-
participant = currentLocal!!,
|
|
1471
|
-
style = RegularVideoRendererStyle().copy(isShowingConnectionQualityIndicator = false),
|
|
1472
|
-
actionsContent = {_, _, _ -> {}},
|
|
1473
|
-
)
|
|
1474
|
-
}
|
|
1475
|
-
)
|
|
1476
|
-
}
|
|
1477
|
-
)
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1326
|
+
setOverlayContent(call)
|
|
1480
1327
|
overlayView?.isVisible = false
|
|
1481
1328
|
bridge?.webView?.setBackgroundColor(Color.WHITE) // Restore webview opacity
|
|
1482
1329
|
|
|
@@ -1646,62 +1493,7 @@ public class StreamCallPlugin : Plugin() {
|
|
|
1646
1493
|
|
|
1647
1494
|
bridge?.webView?.setBackgroundColor(Color.TRANSPARENT) // Make webview transparent
|
|
1648
1495
|
bridge?.webView?.bringToFront() // Ensure WebView is on top and transparent
|
|
1649
|
-
|
|
1650
|
-
VideoTheme {
|
|
1651
|
-
if (streamCall != null) {
|
|
1652
|
-
|
|
1653
|
-
val participants by streamCall.state.participants.collectAsStateWithLifecycle()
|
|
1654
|
-
val sortedParticipants by streamCall.state.sortedParticipants.collectAsStateWithLifecycle(emptyList())
|
|
1655
|
-
val callParticipants by remember(participants) {
|
|
1656
|
-
derivedStateOf {
|
|
1657
|
-
if (sortedParticipants.size > 6) {
|
|
1658
|
-
sortedParticipants
|
|
1659
|
-
} else {
|
|
1660
|
-
participants
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
val currentLocal by streamCall.state.me.collectAsStateWithLifecycle()
|
|
1666
|
-
|
|
1667
|
-
CallContent(
|
|
1668
|
-
call = streamCall,
|
|
1669
|
-
onBackPressed = { /* Handle back press if needed */ },
|
|
1670
|
-
controlsContent = { /* Empty to disable native controls */ },
|
|
1671
|
-
appBarContent = { /* Empty to disable app bar with stop call button */ },
|
|
1672
|
-
videoRenderer = { videoModifier, videoCall, videoParticipant, videoStyle ->
|
|
1673
|
-
ParticipantVideo(
|
|
1674
|
-
modifier = videoModifier,
|
|
1675
|
-
call = videoCall,
|
|
1676
|
-
participant = videoParticipant,
|
|
1677
|
-
style = videoStyle,
|
|
1678
|
-
actionsContent = {_, _, _ -> {}},
|
|
1679
|
-
scalingType = VideoScalingType.SCALE_ASPECT_FIT
|
|
1680
|
-
)
|
|
1681
|
-
},
|
|
1682
|
-
floatingVideoRenderer = { call, parentSize ->
|
|
1683
|
-
FloatingParticipantVideo(
|
|
1684
|
-
call = call,
|
|
1685
|
-
participant = currentLocal!!,
|
|
1686
|
-
style = RegularVideoRendererStyle().copy(isShowingConnectionQualityIndicator = false),
|
|
1687
|
-
parentBounds = parentSize,
|
|
1688
|
-
videoRenderer = { _ ->
|
|
1689
|
-
ParticipantVideo(
|
|
1690
|
-
modifier = Modifier
|
|
1691
|
-
.fillMaxSize()
|
|
1692
|
-
.clip(VideoTheme.shapes.dialog),
|
|
1693
|
-
call = call,
|
|
1694
|
-
participant = currentLocal!!,
|
|
1695
|
-
style = RegularVideoRendererStyle().copy(isShowingConnectionQualityIndicator = false),
|
|
1696
|
-
actionsContent = {_, _, _ -> {}}
|
|
1697
|
-
)
|
|
1698
|
-
}
|
|
1699
|
-
)
|
|
1700
|
-
}
|
|
1701
|
-
)
|
|
1702
|
-
}
|
|
1703
|
-
}
|
|
1704
|
-
}
|
|
1496
|
+
setOverlayContent(streamCall)
|
|
1705
1497
|
overlayView?.isVisible = true
|
|
1706
1498
|
// Ensure overlay is behind WebView by adjusting its position in the parent
|
|
1707
1499
|
val parent = overlayView?.parent as? ViewGroup
|
|
@@ -23,6 +23,37 @@ class CallOverlayViewFactory: ViewFactory {
|
|
|
23
23
|
call: call
|
|
24
24
|
)
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
public func makeVideoCallParticipantModifier(
|
|
28
|
+
participant: CallParticipant,
|
|
29
|
+
call: Call?,
|
|
30
|
+
availableFrame: CGRect,
|
|
31
|
+
ratio: CGFloat,
|
|
32
|
+
showAllInfo: Bool
|
|
33
|
+
) -> some ViewModifier {
|
|
34
|
+
VideoCallParticipantModifier(
|
|
35
|
+
participant: participant,
|
|
36
|
+
call: call,
|
|
37
|
+
availableFrame: availableFrame,
|
|
38
|
+
ratio: ratio,
|
|
39
|
+
showAllInfo: showAllInfo,
|
|
40
|
+
decorations: [.speaking] // Here we only want the speaking decoration
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public func makeLocalParticipantViewModifier(
|
|
45
|
+
localParticipant: CallParticipant,
|
|
46
|
+
callSettings: Binding<CallSettings>,
|
|
47
|
+
call: Call?
|
|
48
|
+
) -> some ViewModifier {
|
|
49
|
+
LocalParticipantViewModifier(
|
|
50
|
+
localParticipant: localParticipant,
|
|
51
|
+
call: call,
|
|
52
|
+
callSettings: callSettings,
|
|
53
|
+
showAllInfo: true,
|
|
54
|
+
decorations: [.speaking] // Here we only need the speaking decoration
|
|
55
|
+
)
|
|
56
|
+
}
|
|
26
57
|
}
|
|
27
58
|
|
|
28
59
|
struct CallOverlayView: View {
|
|
@@ -19,7 +19,7 @@ class TouchInterceptView: UIView {
|
|
|
19
19
|
// Ensure this view is transparent and doesn't interfere with display
|
|
20
20
|
self.backgroundColor = .clear
|
|
21
21
|
self.isOpaque = false
|
|
22
|
-
os_log(.debug, "TouchInterceptView: setupWithWebView - webView: %{public}s, overlayView: %{public}s", String(describing: webView), String(describing: overlayView))
|
|
22
|
+
// os_log(.debug, "TouchInterceptView: setupWithWebView - webView: %{public}s, overlayView: %{public}s", String(describing: webView), String(describing: overlayView))
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
func setActiveCallCheck(_ check: @escaping () -> Bool) {
|
|
@@ -28,7 +28,7 @@ class TouchInterceptView: UIView {
|
|
|
28
28
|
|
|
29
29
|
func setCallActive(_ active: Bool) {
|
|
30
30
|
self.isCallActive = active
|
|
31
|
-
os_log(.debug, "TouchInterceptView: setCallActive - %{public}s", String(describing: active))
|
|
31
|
+
// os_log(.debug, "TouchInterceptView: setCallActive - %{public}s", String(describing: active))
|
|
32
32
|
|
|
33
33
|
// Cancel any pending timer when call becomes inactive
|
|
34
34
|
if !active {
|
|
@@ -44,7 +44,7 @@ class TouchInterceptView: UIView {
|
|
|
44
44
|
let shouldIntercept = isCallActive && hasActiveCall
|
|
45
45
|
|
|
46
46
|
if isCallActive != hasActiveCall {
|
|
47
|
-
os_log(.debug, "TouchInterceptView: State mismatch - isCallActive: %{public}s, hasActiveCall: %{public}s", String(describing: isCallActive), String(describing: hasActiveCall))
|
|
47
|
+
// os_log(.debug, "TouchInterceptView: State mismatch - isCallActive: %{public}s, hasActiveCall: %{public}s", String(describing: isCallActive), String(describing: hasActiveCall))
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
return shouldIntercept
|
|
@@ -99,12 +99,12 @@ class TouchInterceptView: UIView {
|
|
|
99
99
|
return el.tagName;
|
|
100
100
|
})();
|
|
101
101
|
"""
|
|
102
|
-
os_log(.debug, "TouchInterceptView: forwardClickToWeb - (%{public}d,%{public}d)", x, y)
|
|
102
|
+
// os_log(.debug, "TouchInterceptView: forwardClickToWeb - (%{public}d,%{public}d)", x, y)
|
|
103
103
|
wk.evaluateJavaScript(js) { result, error in
|
|
104
104
|
if let error = error {
|
|
105
|
-
os_log(.error, "TouchInterceptView: JS error %{public}s", String(describing: error))
|
|
105
|
+
// os_log(.error, "TouchInterceptView: JS error %{public}s", String(describing: error))
|
|
106
106
|
} else {
|
|
107
|
-
os_log(.debug, "TouchInterceptView: JS returned %{public}s", String(describing: result))
|
|
107
|
+
// os_log(.debug, "TouchInterceptView: JS returned %{public}s", String(describing: result))
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -116,13 +116,13 @@ class TouchInterceptView: UIView {
|
|
|
116
116
|
if let webView = self.webView {
|
|
117
117
|
let webPoint = self.convert(point, to: webView)
|
|
118
118
|
let result = webView.hitTest(webPoint, with: event)
|
|
119
|
-
os_log(.debug, "TouchInterceptView: hitTest - Not intercepting, direct WebView result %{public}s at %{public}s", String(describing: result), String(describing: webPoint))
|
|
119
|
+
// os_log(.debug, "TouchInterceptView: hitTest - Not intercepting, direct WebView result %{public}s at %{public}s", String(describing: result), String(describing: webPoint))
|
|
120
120
|
return result
|
|
121
121
|
}
|
|
122
122
|
return nil
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
os_log(.debug, "TouchInterceptView: hitTest entry at %{public}s, callActive: %{public}s", String(describing: point), String(describing: isCallActive))
|
|
125
|
+
// os_log(.debug, "TouchInterceptView: hitTest entry at %{public}s, callActive: %{public}s", String(describing: point), String(describing: isCallActive))
|
|
126
126
|
|
|
127
127
|
// Check if this is same touch location continuing
|
|
128
128
|
if let lastPoint = lastTouchPoint {
|
|
@@ -130,7 +130,7 @@ class TouchInterceptView: UIView {
|
|
|
130
130
|
if distance <= touchThreshold {
|
|
131
131
|
// Same touch continuing, cancel existing timer
|
|
132
132
|
forwardTimer?.invalidate()
|
|
133
|
-
os_log(.debug, "TouchInterceptView: Touch continuing at %{public}s, cancelling timer", String(describing: point))
|
|
133
|
+
// os_log(.debug, "TouchInterceptView: Touch continuing at %{public}s, cancelling timer", String(describing: point))
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -139,10 +139,10 @@ class TouchInterceptView: UIView {
|
|
|
139
139
|
forwardTimer?.invalidate()
|
|
140
140
|
forwardTimer = Timer.scheduledTimer(withTimeInterval: timerDelay, repeats: false) { [weak self] _ in
|
|
141
141
|
guard let self = self, self.shouldInterceptTouches() else {
|
|
142
|
-
os_log(.debug, "TouchInterceptView: Timer fired but no longer in call, skipping web forward")
|
|
142
|
+
// os_log(.debug, "TouchInterceptView: Timer fired but no longer in call, skipping web forward")
|
|
143
143
|
return
|
|
144
144
|
}
|
|
145
|
-
os_log(.debug, "TouchInterceptView: Timer fired, forwarding click to web at %{public}s", String(describing: point))
|
|
145
|
+
// os_log(.debug, "TouchInterceptView: Timer fired, forwarding click to web at %{public}s", String(describing: point))
|
|
146
146
|
self.forwardClickToWeb(at: point)
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -150,7 +150,7 @@ class TouchInterceptView: UIView {
|
|
|
150
150
|
if let overlayView = self.overlayView, !overlayView.isHidden {
|
|
151
151
|
let overlayPoint = self.convert(point, to: overlayView)
|
|
152
152
|
if let overlayHit = nonGreedyInteractiveHitTest(in: overlayView, point: overlayPoint, with: event) {
|
|
153
|
-
os_log(.debug, "TouchInterceptView: hitTest - Overlay view %{public}s at %{public}s", String(describing: overlayHit), String(describing: overlayPoint))
|
|
153
|
+
// os_log(.debug, "TouchInterceptView: hitTest - Overlay view %{public}s at %{public}s", String(describing: overlayHit), String(describing: overlayPoint))
|
|
154
154
|
return overlayHit
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -158,10 +158,10 @@ class TouchInterceptView: UIView {
|
|
|
158
158
|
if let webView = self.webView {
|
|
159
159
|
let webPoint = self.convert(point, to: webView)
|
|
160
160
|
let result = webView.hitTest(webPoint, with: event)
|
|
161
|
-
os_log(.debug, "TouchInterceptView: hitTest - WebView result %{public}s at %{public}s", String(describing: result), String(describing: webPoint))
|
|
161
|
+
// os_log(.debug, "TouchInterceptView: hitTest - WebView result %{public}s at %{public}s", String(describing: result), String(describing: webPoint))
|
|
162
162
|
return result
|
|
163
163
|
}
|
|
164
|
-
os_log(.debug, "TouchInterceptView: hitTest - No view found for %{public}s", String(describing: point))
|
|
164
|
+
// os_log(.debug, "TouchInterceptView: hitTest - No view found for %{public}s", String(describing: point))
|
|
165
165
|
return nil
|
|
166
166
|
}
|
|
167
167
|
|
|
@@ -173,16 +173,16 @@ class TouchInterceptView: UIView {
|
|
|
173
173
|
}
|
|
174
174
|
let webViewPoint = self.convert(point, to: webView)
|
|
175
175
|
let result = webView.point(inside: webViewPoint, with: event)
|
|
176
|
-
os_log(.debug, "TouchInterceptView: point(inside) - Not intercepting, WebView only (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: result), String(describing: webViewPoint), String(describing: point), String(describing: result))
|
|
176
|
+
// os_log(.debug, "TouchInterceptView: point(inside) - Not intercepting, WebView only (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: result), String(describing: webViewPoint), String(describing: point), String(describing: result))
|
|
177
177
|
return result
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
guard let webView = self.webView else {
|
|
181
|
-
os_log(.debug, "TouchInterceptView: point(inside) - webView is nil for point %{public}s. Checking overlay or deferring to super.", String(describing: point))
|
|
181
|
+
// os_log(.debug, "TouchInterceptView: point(inside) - webView is nil for point %{public}s. Checking overlay or deferring to super.", String(describing: point))
|
|
182
182
|
if let overlayView = self.overlayView, !overlayView.isHidden {
|
|
183
183
|
let overlayPoint = self.convert(point, to: overlayView)
|
|
184
184
|
let overlayViewConsidersPointInside = overlayView.point(inside: overlayPoint, with: event)
|
|
185
|
-
os_log(.debug, "TouchInterceptView: point(inside) - webView nil. Overlay (%{public}s) for converted point %{public}s = %s", String(describing: overlayViewConsidersPointInside), String(describing: overlayPoint), String(describing: overlayViewConsidersPointInside))
|
|
185
|
+
//os_log(.debug, "TouchInterceptView: point(inside) - webView nil. Overlay (%{public}s) for converted point %{public}s = %s", String(describing: overlayViewConsidersPointInside), String(describing: overlayPoint), String(describing: overlayViewConsidersPointInside))
|
|
186
186
|
return overlayViewConsidersPointInside
|
|
187
187
|
}
|
|
188
188
|
return super.point(inside: point, with: event)
|
|
@@ -195,13 +195,13 @@ class TouchInterceptView: UIView {
|
|
|
195
195
|
let overlayPoint = self.convert(point, to: overlayView)
|
|
196
196
|
let overlayViewConsidersPointInside = overlayView.point(inside: overlayPoint, with: event)
|
|
197
197
|
let result = webViewConsidersPointInside || overlayViewConsidersPointInside
|
|
198
|
-
os_log(.debug, "TouchInterceptView: point(inside) - WebView (%{public}s at %{public}s) OR Visible Overlay (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: webViewConsidersPointInside), String(describing: webViewPoint), String(describing: overlayViewConsidersPointInside), String(describing: overlayPoint), String(describing: point), String(describing: result))
|
|
198
|
+
// os_log(.debug, "TouchInterceptView: point(inside) - WebView (%{public}s at %{public}s) OR Visible Overlay (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: webViewConsidersPointInside), String(describing: webViewPoint), String(describing: overlayViewConsidersPointInside), String(describing: overlayPoint), String(describing: point), String(describing: result))
|
|
199
199
|
return result
|
|
200
200
|
} else {
|
|
201
201
|
if self.overlayView == nil {
|
|
202
|
-
os_log(.debug, "TouchInterceptView: point(inside) - Overlay nil. WebView (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: webViewConsidersPointInside), String(describing: webViewPoint), String(describing: point), String(describing: webViewConsidersPointInside))
|
|
202
|
+
// os_log(.debug, "TouchInterceptView: point(inside) - Overlay nil. WebView (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: webViewConsidersPointInside), String(describing: webViewPoint), String(describing: point), String(describing: webViewConsidersPointInside))
|
|
203
203
|
} else {
|
|
204
|
-
os_log(.debug, "TouchInterceptView: point(inside) - Overlay hidden. WebView (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: webViewConsidersPointInside), String(describing: webViewPoint), String(describing: point), String(describing: webViewConsidersPointInside))
|
|
204
|
+
// os_log(.debug, "TouchInterceptView: point(inside) - Overlay hidden. WebView (%{public}s at %{public}s) for original point %{public}s = %s", String(describing: webViewConsidersPointInside), String(describing: webViewPoint), String(describing: point), String(describing: webViewConsidersPointInside))
|
|
205
205
|
}
|
|
206
206
|
return webViewConsidersPointInside
|
|
207
207
|
}
|
package/package.json
CHANGED