Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added zoom and pan changes #264

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ActiveSpeakerFragment : VideoGridBaseFragment() {
meetingViewModel?.updateTrackStatus(statsString)
}
binding.screenShare.raisedHand.alpha = visibilityOpacity(CustomPeerMetadata.fromJson(it.peer.metadata)?.isHandRaised == true)
bindSurfaceView(binding.screenShare, it, RendererCommon.ScalingType.SCALE_ASPECT_FIT)
bindSurfaceView(binding.screenShare, it, RendererCommon.ScalingType.SCALE_ASPECT_FIT, true)
}
super.onResume()
}
Expand Down Expand Up @@ -161,7 +161,8 @@ class ActiveSpeakerFragment : VideoGridBaseFragment() {
bindSurfaceView(
binding.screenShare,
screen,
RendererCommon.ScalingType.SCALE_ASPECT_FIT
RendererCommon.ScalingType.SCALE_ASPECT_FIT,
true
)
}
bindVideo(binding.screenShare, screen)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ abstract class VideoGridBaseFragment : Fragment() {
protected fun bindSurfaceView(
binding: VideoCardBinding,
item: MeetingTrack,
scalingType: RendererCommon.ScalingType = RendererCommon.ScalingType.SCALE_ASPECT_BALANCED
scalingType: RendererCommon.ScalingType = RendererCommon.ScalingType.SCALE_ASPECT_BALANCED,
enableZoom : Boolean = false
) {
Log.d(TAG,"bindSurfaceView for :: ${item.peer.name}")
val earlyExit = item.video == null
Expand All @@ -171,7 +172,7 @@ abstract class VideoGridBaseFragment : Fragment() {
binding.surfaceView.let { view ->
view.setScalingType(scalingType)
view.setEnableHardwareScaler(true)

view.enableZoomAndPan(enableZoom)
SurfaceViewRendererUtil.bind(view, item).let { success ->
if (success) {
binding.surfaceView.visibility = if (item.video?.isDegraded == true ) View.INVISIBLE else View.VISIBLE
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/video_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:layout_centerInParent="true"
android:layout_height="wrap_content">

<org.webrtc.SurfaceViewRenderer
<live.hms.video.video.HMSVideoView
android:id="@+id/surface_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down