# Video crop issue on landscape view on web

**URL:** <https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619>\
**Category:** Web\
**Tags:** video-sdk\
**Created:** [February 11, 2024, 9:45am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619 "2024-02-11T09:45:15Z")\
**Posts on this page:** 19\
**Page:** 2

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 7, 2024, 12:30pm UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/21 "2024-03-07T12:30:12Z")

</div>

3MfvdJGkR5iK0Eg07KHxGw==  
g+muPFaCQ/ekwxJa+buVpg==  
'+QPJA6vETOeVH5WeL/uH5Q==  
9XI8DaQWS4OF7RuBrkLBtA==  
QPkDg3H+TsOdy29DGNW8Ew==  
cc5wIAY1RlChHZwW/VwBHw==  
j9pV218yTDqlf5SdnTdjcA==  
jOUTx29MRjmUr9AWM0kv/g==  
uSBUcRubTtyeJd+tz9j10w==  
x0uDbGT2S7uoJ/YPPADevA==  
mkz7Ko+ORg2vzTK91GU1lw==  
V3ZelqiWSKiK2HGy/+It7A==  
vwxxQrb+RvyR3wzhDCwanQ==  
8enTtGc9RUC4E0XOn5Q/cw==  
RiVw3H70RDaljMeeW+OLBQ==  
egYNe4geT++9ABFXxmYYkg==  
/LoLMK6OR3Kwf3t3aEPuYw==  
b6UqMc0/TbWBMQkDKh0A1w==  
iGPh9G3/T1iaS2oUuYLE7w==  
gpKmsgneTbSRPUfJTxr/Xg==  
zH5A4CHdR2KdJK+6UHlVDg==  
rcTdegfOS8iy1xmbhMM4ww==  
8kIG0j2sQ6Kxm7A8PqPXqQ==

From this, some of the IDs did not get the proper connection to Zoom in React Native for the attendees.  
RJHexpyQqu0fqVSzGUlMg==  
im using “@zoom/react-native-videosdk”: “^1.6.2”, version

When connecting to Zoom from our office network, the connection is not consistently established most of the time, and I don’t know why. Strangely, it works fine on my home WiFi, and both networks are in good condition. We conducted a Zoom meeting for testing purposes, and it worked smoothly there. I’m puzzled about why this issue is occurring, especially within the context of the video SDK.  
**r0qEJy2QQTK5RJGsC+L2oA==** (Home wifi)

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 8, 2024, 7:23am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/22 "2024-03-08T07:23:39Z")

</div>

Does anyone know how to solve this issue?

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [March 8, 2024, 7:32am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/23 "2024-03-08T07:32:00Z")

</div>

Hey @dev.jestinxavier

Thank you for sharing these sessions with us.

We have conducted preliminary checks, and many sessions only lasted around 1 minute or had only one participant. Only one session matches the case you described, and we are analyzing it.

> g+muPFaCQ/ekwxJa+buVpg==

As for this session `RJHexpyQqu0fqVSzGUlMg==`, we cannot find any log related to it.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 8, 2024, 7:36am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/24 "2024-03-08T07:36:00Z")

</div>

+lBmx37PSsCISlqsMbp5/Q==  
blank screen on both sides no video feed.

MVGEA5nrSjS+YAC4in2XuQ==  
didn’t get the video feed on both sides.

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 8, 2024, 3:25pm UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/25 "2024-03-08T15:25:13Z")

</div>

Is this a network or firewall issue? If yes, how can we confirm that?

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [March 11, 2024, 3:13am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/26 "2024-03-11T03:13:15Z")

</div>

Hey @dev.jestinxavier

We analyzed the two sessions you provided, and we found that the downlink latency is very high on the web side.

> MVGEA5nrSjS+YAC4in2XuQ==

On the React Native side, the method to render the video of the remote participant was called only after 1.5 minutes after enabling the camera on the Web side. We need your assistance in investigating this further.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 11, 2024, 5:58am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/27 "2024-03-11T05:58:21Z")

</div>

```auto
import React, { useState, useEffect, useRef } from "react";
import {
  View,
  StyleSheet,
  ScrollView,
} from "react-native";
import { VideoView } from "../../components/VideoView";
import { useZoom } from "@zoom/react-native-videosdk";
import { useIsMounted } from "../../hooks/hooks";
import { useSocket } from "../../context/SocketContext";
import ApplicationLog from "../../api/ApplicationLog";
import axios from "axios";
import ErrorBoundary from "../../components/ErrorBoundary/ErrorBoundary";
import {
  ROLETYPE,
  UIDSTORING,
  ZOOMCREDENTIALS,
  videoCredential,
} from "../../Recoil/recoilState";
import { useRecoilState, useRecoilValue } from "recoil";
export function VideoCallScreen() {
  const [users, setUsers] = useState([]);
  const [isInSession, setIsInSession] = useState(false);
  const [signatureData, setSignatureData] = useState(null);
  const [myselfUserId, setMyselfUserId] = useState(null);
  const [isFullScreen, setIsFullScreen] = useState(false);
  const [route, setRoute] = useRecoilState(ROLETYPE);
  const [zoomCredentials, setZoomCredentials] = useRecoilState(ZOOMCREDENTIALS);
  const isFirstRender = useRef(true);
  const uid = useRecoilValue(UIDSTORING);
  const [zoomSecretKeyCredentials, setZoomSecretKeyCredentials] = useRecoilState(videoCredential);

  const [name, setName] = useState("");
  const zoom = useZoom();
  const isMounted = useIsMounted();
  const { socket } = useSocket();

  //const toggleFullScreen = () => {
    // setIsFullScreen(!isFullScreen);
  //};
  useEffect(() => {
    socket?.on("callEnded", (data) => {
      leaveSession();
      navigation.navigate("Checking");
      
    });
    return () => {
      socket?.off("participantLeft");
    };
  }, [socket]);

  const sendLogToPhone = (data) => {
    const uniqId = uid?.data?.robot?.uuid;

    const acknowledgementData = { id: uniqId, mobileLog: data };
    socket?.emit("sentToPhone", acknowledgementData);
  };

  useEffect(() => {
    const fetchSignature = async (zoomCredentialsData) => {
    
      try {
        if (isFirstRender.current) {
          
// Here I'm using localhost for development
          const response = await axios.post(
            "http://192.168.1.7:5000/generateSignature",
            {
              sessionName: zoomCredentialsData.payload.data.sessionName,
              role: route.roleType,
              sessionKey: zoomCredentialsData.payload.data.sessionKey,
              userIdentity: route.displayName,
            },
            { timeout: 9000 }
          );

             socket?.emit("sentToPhone", response);

          const { signature } = response.data;
          console.log({ signature });
          setSignatureData(signature);
        }
        
      } catch (error) {
        if (error.response) {
          socket?.emit("sentToPhone", {'111':error.response});
        } else if (error.request) {
          socket?.emit("sentToPhone", {'117':error.request});

   
        } else {
          // Something happened in setting up the request that triggered an Error
          socket?.emit("sentToPhone", {'128':error.message});

          console.error("Error message:", error.message);
         
        }
       
      }
    };

    console.log({zoomSecretKeyCredentials,zoomCredentials});
    if (zoomCredentials) {
      setName(zoomCredentials.payload.data.name);
      fetchSignature(zoomCredentials);
    }

   
    sendLogToPhone(zoomCredentials);

    socket?.emit("callEnded", (data) => {
      leaveSession();
      navigation.navigate("Checking");
      
    });
  }, [zoomCredentials, socket]);

  useEffect(() => {
    async function joinSession() {
      if (signatureData) {
        try {
          let dataTop = await zoom.joinSession({
            sessionName: zoomCredentials.payload.data.sessionName,
            sessionIdleTimeoutMins: 30,
            sessionPassword: zoomCredentials.payload.data.userIdentity,
            token: signatureData,
            userName: route.displayName,
            audioOptions: { connect: true, mute: false },
            videoOptions: { localVideoOn: true },
          });
     
          sendLogToPhone({
            zoomJoinSession: dataTop,
            message: "zoomJoining session with signature -3",
          });
          const mySelf = await zoom.session.getMySelf();
          setUsers([mySelf]);
          const cameraList = await zoom.videoHelper.getCameraList();
       
          sendLogToPhone({
            cameraList: cameraList,
            message: "cameraList -4",
          });
        } catch (error) {
          console.error("Error joining session:", error);
          
          sendLogToPhone({ error, message: "join section try catch error" });
        }
      }
    }

    if (signatureData && isFirstRender.current) {
      joinSession();
      isFirstRender.current = false; // Set isFirstRender to false after the initial render
    }

    const sessionJoinListener = zoom.addListener("onSessionJoin", async () => {
      sendLogToPhone({ message: "onSessionJoin event is triggered 5" });
      await ApplicationLog({
        message: "onSessionJoin event is triggered 5",
      });
      zoom.audioHelper.startAudio();
      setIsInSession(true);

      // Retrieve mySelf within the listener
      const mySelf = await zoom.session.getMySelf();
      zoom.audioHelper.unmuteAudio(mySelf.userId);
      setMyselfUserId(mySelf.userId);
      const remoteUsers = await zoom.session.getRemoteUsers();
      sendLogToPhone({ remoteUsers, getRemoteUsers: "getRemoteUsers" });
      await ApplicationLog({
        remoteUsers: remoteUsers,
        message: "onSessionJoin event remoteUsers data 5",
      });
      setUsers((prevUsers) => [...prevUsers, ...remoteUsers]);
    });

    const sessionLeaveListener = zoom.addListener("onSessionLeave", () => {
      setIsInSession(false);
      setUsers([]);
    });

    return () => {
      sessionJoinListener.remove();
      sessionLeaveListener.remove();
    };
  }, [zoom, signatureData, zoomCredentials]);

  const leaveSession = () => {
    zoom.leaveSession(false);
  };

  

  

  

  return (
    <View style={styles.container}>
      <ErrorBoundary>
        <ScrollView>
         
          {users.length > 0 && (
            <View style={{ marginTop: 28 }}>
              <RenderUsers
                users={users}
                ApplicationLog={ApplicationLog}
                name={name}
                isFullScreen={isFullScreen}
                toggleFullScreen={toggleFullScreen}
              />
            </View>
          )}
         
        </ScrollView>
      </ErrorBoundary>
    </View>
  );
}

export default VideoCallScreen;
export const RenderUsers = ({
  users,
  ApplicationLog,
  name,
  isFullScreen,
  toggleFullScreen,
}) => {
  let targetUser = users.filter((userData) => userData.userName == name);
  // console.log({ targetUser }, { users });
  ApplicationLog({
    users: users,
    message: "this is the User data 6 ",
  });
  ApplicationLog({
    name: name,
    message: "the name of the data 7",
  });

  ApplicationLog({
    targetUser: targetUser,
    message: "target User data 8",
  });

  return targetUser?.map((user) => (
    <VideoView
      user={user}
      fullScreen={isFullScreen}
      key={user.userId}
      onPress={toggleFullScreen}
    />
  ));
};
const styles = StyleSheet.create({
  container: {
    flex: 2,
    alignItems: "center",
    backgroundColor: "#F5FCFF",
  },
  container2: {
    flex: 1,
    backgroundColor: "#F5FCFF",
  },
  button: {
    backgroundColor: "red",
    padding: 10,
  },
  userList: {
    width: "100%",
  },
  userListContentContainer: {
    flexGrow: 1,
    justifyContent: "center",
  },
  chatInputWrapper: {
    flexDirection: "row",
    justifyContent: "space-between",
    alignItems: "center",
  },
  chatInput: {
    flex: 1,
    height: 40,
    marginVertical: 8,
    paddingHorizontal: 16,
    borderRadius: 6,
    borderWidth: 1,
    borderColor: "#666",
    color: "#AAA",
    backgroundColor: "rgba(0,0,0,0.6)",
  },
  chatSendButton: {
    height: 36,
  },
  modalContainer: {
    flex: 1,
    justifyContent: "center",
    alignItems: "center",
    backgroundColor: "rgba(0,0,0,0.5)",
  },
  modal: {
    paddingTop: 16,
    paddingBottom: 24,
    paddingLeft: 24,
    paddingRight: 16,
    borderRadius: 8,
    backgroundColor: "#FFF",
  },
  modalTitleText: {
    fontSize: 18,
    marginBottom: 8,
  },
  modalActionContainer: {
    flexDirection: "row",
    justifyContent: "center",
  },
  modalAction: {
    marginTop: 16,
    paddingHorizontal: 24,
  },
  modalActionText: {
    fontSize: 14,
    fontWeight: "bold",
    color: "#666",
  },
  moreItem: {
    flexDirection: "row",
    marginTop: 16,
    justifyContent: "space-between",
    alignItems: "center",
  },
  moreItemText: {
    fontSize: 16,
  },
  moreItemIcon: {
    width: 36,
    height: 36,
    marginLeft: 48,
  },
  moreModalTitle: {
    fontSize: 24,
  },
  renameInput: {
    width: 200,
    marginTop: 16,
    borderWidth: 0,
    borderBottomWidth: 1,
    borderColor: "#AAA",
    color: "#000",
  },
  keyboardArea: {
    height: 0,
    width: 0,
    zIndex: -100,
  },
});

```

`I'm sharing with you the React native code that I'm using here. zoomSecretKeyCredentials is passed from the web by using SockitIO.`Preformatted text`

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 11, 2024, 6:48am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/28 "2024-03-11T06:48:36Z")

</div>

I ran this application on a different WiFi network, specifically my home WiFi, and it worked seamlessly. This has left me confused as to whether the issue lies with the firewall. Are there any specific ports or IP addresses that I need to enable to use this service effectively?

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [March 11, 2024, 6:56am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/29 "2024-03-11T06:56:41Z")

</div>

Hey @dev.jestinxavier

Here are our general Zoom-related network firewall and proxy settings for your reference:

[https://support.zoom.com/hc/en/article?id=zm\_kb&sysparm\_article=KB0060548](https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0060548)

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 11, 2024, 7:22am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/30 "2024-03-11T07:22:52Z")

</div>

Hey @vic.yang, is there any issue with the code for joining the session or rendering video time? If there’s an issue, please correct me. Do you need any other information from my side to help solve this problem?

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 11, 2024, 8:15am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/31 "2024-03-11T08:15:43Z")

</div>

It seems there is a problem with rendering the video on the React Native side at times. Could you please check the code and guide me through it?

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [March 12, 2024, 5:01am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/33 "2024-03-12T05:01:20Z")

</div>

Hey @elaine.ku

Can you help me check if there is any issue with the code written in React Native?

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 12, 2024, 5:16am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/34 "2024-03-12T05:16:44Z")

</div>

yes of course. What type of help do you need? it is working in my dev environment.

---

<div class="post-metadata">

**Author:** ![elaine.ku](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elaine.ku/32/40026_2.png) [@elaine.ku](https://devforum.zoom.us/u/elaine.ku)\
**Post date:** [March 12, 2024, 6:20am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/35 "2024-03-12T06:20:12Z")

</div>

Hi @dev.jestinxavier ,

I checked the code and it looks okay from my side. The downlink of the session is the react native participant. If the downlink latency is high, it might cause an issue with video quality.

There will be a delay between calling `joinSession` function and receiving `sessionJoinListener` if the network is bad. Once the `sessionJoinListener` is triggered, there will also be a small delay in your App since the UI needs to be refreshed due to `setIsInSession(true);` is called.

Thank you.

Elaine

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 14, 2024, 6:47am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/36 "2024-03-14T06:47:15Z")

</div>

oBrqgf78XQdmUqB2fb8Bf4g==  
in the React native i didn’t get the host Video stream

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 14, 2024, 7:18am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/37 "2024-03-14T07:18:29Z")

</div>

lg73CcI+ToGV+IORaILNUQ==  
it shows a black screen in the app no video stream.

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [March 14, 2024, 11:23am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/38 "2024-03-14T11:23:53Z")

</div>

kgRrSd/kTIq6ar/NPRr4+g==  
in this meeting, I didn’t get the remote users and onSessionJoin is not triggered. How can I solve this

---

<div class="post-metadata">

**Author:** ![dev.jestinxavier](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dev.jestinxavier/32/55229_2.png) [@dev.jestinxavier](https://devforum.zoom.us/u/dev.jestinxavier)\
**Post date:** [April 5, 2024, 8:21am UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/39 "2024-04-05T08:21:23Z")

</div>

Hi, I just integrated the Zoom SDK into React Native. I initiated a call with a high-quality camera, but it’s showing a small 2-second delay or getting stuck in the view. Could you please guide me on how to solve this issue?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [May 5, 2024, 6:22pm UTC](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619/40 "2024-05-05T18:22:14Z")

</div>

Closed on May 5, 2024, 6:22pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

[Previous page](https://devforum.zoom.us/t/video-crop-issue-on-landscape-view-on-web/103619.md?page=1)
