QuickBlox / quickblox-android-sdk

QuickBlox Android SDK includes code snippets with main use cases and framework JAR library.
BSD 3-Clause "New" or "Revised" License
417 stars 697 forks source link

setScalingType does not work #688

Closed Esvux closed 3 years ago

Esvux commented 5 years ago

Environment details

Description When my app receives a new remote video track (the app only works with peer-to-peer video calls), the video is rendered correctly but not display according to the scaling type.

    @Override
    public void onRemoteVideoTrackReceive(QBRTCSession session, final QBRTCVideoTrack videoTrack, final Integer userID) {
        Log.d(TAG, "onRemoteVideoTrackReceive for opponent= " + userID);

        if (localVideoTrack != null) {
            fillVideoView(localVideoView, localVideoTrack, false);
        }
        isLocalVideoFullScreen = false;
        setDuringCallActionBar();
        fillVideoView(userID, remoteFullScreenVideoView, videoTrack, true);
        updateVideoView(remoteFullScreenVideoView, false);
    }

Expected behavior I expect that calling the method setScalingType with SCALE_ASPECT_FIT as argument the video should be adjust automatically, putting horizontal or vertical black bars. surfaceViewRenderer.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT);

Actual behavior The video is not adjusted automatically.

Any others comments? Actually, I adjust the size manually using margins, but it's depends for the remote video aspect ratio. This works fine if the aspect-ratio is 4:3. Extra question, is there a way to know the aspect ratio or the resolution of remote video source?

alexparvus1 commented 4 years ago

As I checked - Scaling Type works fine.

If something works wrong you can compare the logic with the sample - https://github.com/QuickBlox/quickblox-android-sdk/tree/master/sample-videochat-java

There are three scaling types for QBSurfaceView:

ScalingType scalingType; scalingType = RendererCommon.ScalingType.SCALE_ASPECT_FIT; scalingType = RendererCommon.ScalingType.SCALE_ASPECT_FILL; scalingType = RendererCommon.ScalingType.SCALE_ASPECT_BALANCED;

surfaceViewRenderer.setScalingType(scalingType);

ghost commented 3 years ago

Hello QuickBlox customer,

This is Nikolay from QuickBlox support.

The issue was closed as it was outdated.

Please check the relevant section of our documentation here: https://docs.quickblox.com/docs/android-video-calling

Also, please update the SDK to the latest version: https://github.com/QuickBlox/quickblox-android-sdk-releases/releases/tag/3.9.11

Additionally, please check our new samples: https://docs.quickblox.com/docs/code-samples#video-calling-samples

If it is still relevant after reviewing the updated information, feel free to open a new issue.

Have a nice day.