Added click stream event with network quality (#4679)
This commit is contained in:
committed by
GitHub Enterprise
parent
4c62e5d086
commit
24a5ca9085
@@ -48,12 +48,10 @@ class VKYCMeetingRoomFragment : BaseFragment(), NaviHeaderView.InteractionListen
|
||||
override val screenName: String
|
||||
get() = VkycNaviAnalytics.VKYC_MEETING_ROOM_SCREEN
|
||||
|
||||
private val naviAnalyticsEventTracker = VkycNaviAnalytics.naviAnalytics.MeetingRoomFragment()
|
||||
private val hmsSdk by lazy { HMSSDK.Builder(requireActivity().application).build() }
|
||||
|
||||
var binding: VkycMeetingRoomFragmentBinding? = null
|
||||
|
||||
private var sinkAdded: Boolean = false
|
||||
|
||||
private lateinit var vkycViewModel: VKYCViewModel
|
||||
|
||||
override fun onCreateView(
|
||||
@@ -171,7 +169,7 @@ class VKYCMeetingRoomFragment : BaseFragment(), NaviHeaderView.InteractionListen
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
binding?.videoSurfaceView?.apply {
|
||||
setEnableHardwareScaler(true)
|
||||
setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT)
|
||||
setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_BALANCED)
|
||||
init(SharedEglContext.context, null)
|
||||
it.addSink(this)
|
||||
}
|
||||
@@ -224,6 +222,7 @@ class VKYCMeetingRoomFragment : BaseFragment(), NaviHeaderView.InteractionListen
|
||||
|
||||
override fun onPeerUpdate(type: HMSPeerUpdate, peer: HMSPeer) {
|
||||
addVideo()
|
||||
naviAnalyticsEventTracker.updateNetworkQualityEvent(hmsSdk.getLocalPeer()?.networkQuality?.downlinkQuality)
|
||||
}
|
||||
|
||||
override fun onRoleChangeRequest(request: HMSRoleChangeRequest) {}
|
||||
|
||||
@@ -61,6 +61,42 @@ class VkycNaviAnalytics private constructor() {
|
||||
NaviTrackEvent.trackEventOnClickStream("PL_VKYC_Permissions_Continue_Clicked")
|
||||
}
|
||||
|
||||
inner class MeetingRoomFragment {
|
||||
|
||||
/**
|
||||
-1 -> Undefined - yet to be determined or not enough data to determine
|
||||
0 -> Disconnected or error in measuring score(in preview)
|
||||
1 -> Very Bad Connection
|
||||
2 -> Bad Connection
|
||||
3 -> Moderate Connection
|
||||
4 -> Good Connection
|
||||
5 -> Excellent Connection
|
||||
**/
|
||||
fun updateNetworkQualityEvent(downLinkQuality: Int?) {
|
||||
NaviTrackEvent.trackEventOnClickStream(
|
||||
"PL_VKYC_Network_Quality", mapOf(
|
||||
Pair(
|
||||
"downLinkQuality",
|
||||
getNetworkQuality(downLinkQuality)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private fun getNetworkQuality(downLinkQuality: Int?): String {
|
||||
return when (downLinkQuality) {
|
||||
0 -> "Disconnected"
|
||||
1 -> "Very Bad Connection"
|
||||
2 -> "Bad Connection"
|
||||
3 -> "Moderate Connection"
|
||||
4 -> "Good Connection"
|
||||
5 -> "Excellent Connection"
|
||||
else -> "Undefined"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inner class AgentWaitingScreen {
|
||||
|
||||
fun onWaitingForAgentScreenShown() {
|
||||
|
||||
Reference in New Issue
Block a user