You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
In my UI TextureRendererView was placed with MATCH_PARENT constraint so it fill whole space. I was trying to display on it video with different orientation using RendererCommon.ScalingType. What i mean: If video landscape and phone is portrait it has to be FIT inside view not FILL.
But its not possible because in issue 416 was said that i have to use WRAP_CONTENT constraint for min video side.
This mean that if i wanna fit video in TextureRendererView i need follow this algorithm:
Detect video orientation
Depend on video orientation set correct view layout params
Add view as renderer in VideoTrack
Video dimensions is possible to get from TrackPublication.dimensions field. But there is problem with android LiveKit SDK:
when user change phone orientation dimensions not changing even if user turn video off and on again. IOS sdk doesn't have this problem - android receive event about changing opponent video with changed dimensions when IOS user rotate phone.
I was trying to change capture video params by calling this code but this not affect anything at all
fun processOrientationChanged(orientation: Int) {
val track = room.localParticipant?.videoTrackPublications?.firstOrNull()?.first?.track
val isPortrait = orientation == Configuration.ORIENTATION_PORTRAIT
val width = if (isPortrait) VideoPreset169.H720.capture.height else VideoPreset169.H720.capture.width
val height = if (isPortrait) VideoPreset169.H720.capture.width else VideoPreset169.H720.capture.height
val capturer = (track as? LocalVideoTrack)?.capturer
capturer?.changeCaptureFormat(width, height, VideoPreset169.H720.capture.maxFps)
}
I got missing something
Maybe there another way to get video dimensions
Please help
The text was updated successfully, but these errors were encountered:
Hello
In my UI
TextureRendererView
was placed with MATCH_PARENT constraint so it fill whole space. I was trying to display on it video with different orientation usingRendererCommon.ScalingType
. What i mean: If video landscape and phone is portrait it has to be FIT inside view not FILL.But its not possible because in issue 416 was said that i have to use WRAP_CONTENT constraint for min video side.
This mean that if i wanna fit video in TextureRendererView i need follow this algorithm:
Video dimensions is possible to get from
TrackPublication.dimensions
field. But there is problem with android LiveKit SDK:when user change phone orientation dimensions not changing even if user turn video off and on again. IOS sdk doesn't have this problem - android receive event about changing opponent video with changed dimensions when IOS user rotate phone.
I was trying to change capture video params by calling this code but this not affect anything at all
I got missing something
Maybe there another way to get video dimensions
Please help
The text was updated successfully, but these errors were encountered: