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
That if I speak on the phone, it will be heard on the other device that's connected to the room (Already tested to work with another phone that has a native Twilio implementation, and connected to room PorteroVisor2, so the receiving device works fine)
Here is the full code I'm using. I've removed the video components to just have the bare minimum to publish only my audio. Bear in mind I also tested with the video code before removing it as well.
`import React, { useRef, useState } from "react";
import { Button, TextInput, View, Text, TouchableOpacity, Platform, PermissionsAndroid } from "react-native";
import {
TwilioVideo,
RoomErrorEventArgs,
} from "react-native-twilio-video-webrtc";
import styles from "@/assets/styles/twilioStyles";
const _requestAudioPermission = () => {
return PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
{
title: "Need permission to access microphone",
message:
"To run this demo we need permission to access your microphone",
buttonNegative: "Cancel",
buttonPositive: "OK",
}
);
};
const _requestCameraPermission = () => {
return PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.CAMERA, {
title: "Need permission to access camera",
message: "To run this demo we need permission to access your camera",
buttonNegative: "Cancel",
buttonPositive: "OK",
});
};
Steps to reproduce
Expected behaviour
That if I speak on the phone, it will be heard on the other device that's connected to the room (Already tested to work with another phone that has a native Twilio implementation, and connected to room PorteroVisor2, so the receiving device works fine)
Actual behaviour
I speak but nothing is heard on the other end.
Environment
react-native-twilio-video-webrtc
Version: ^3.2.1
Here is the full code I'm using. I've removed the video components to just have the bare minimum to publish only my audio. Bear in mind I also tested with the video code before removing it as well.
`import React, { useRef, useState } from "react";
import { Button, TextInput, View, Text, TouchableOpacity, Platform, PermissionsAndroid } from "react-native";
import {
TwilioVideo,
RoomErrorEventArgs,
} from "react-native-twilio-video-webrtc";
import styles from "@/assets/styles/twilioStyles";
export default function TwilioTest() {
const [isAudioEnabled, setIsAudioEnabled] = useState(true);
const [status, setStatus] = useState("disconnected");
const [token, setToken] = useState("eyJ......");
const twilioRef = useRef(null);
const _requestAudioPermission = () => {
return PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
{
title: "Need permission to access microphone",
message:
"To run this demo we need permission to access your microphone",
buttonNegative: "Cancel",
buttonPositive: "OK",
}
);
};
const _requestCameraPermission = () => {
return PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.CAMERA, {
title: "Need permission to access camera",
message: "To run this demo we need permission to access your camera",
buttonNegative: "Cancel",
buttonPositive: "OK",
});
};
const _onConnectButtonPress = async () => {
if (Platform.OS === "android") {
await _requestAudioPermission();
await _requestCameraPermission();
}
};
const _onEndButtonPress = () => {
twilioRef.current?.disconnect();
};
const _onMuteButtonPress = () => {
twilioRef.current?.setLocalAudioEnabled(!isAudioEnabled)
.then((isEnabled: boolean) => setIsAudioEnabled(isEnabled));
};
const _onRoomDidConnect = ({ roomName }: any) => {
console.log("onRoomDidConnect: ", roomName);
twilioRef.current?.publishLocalAudio();
};
const _onRoomDidDisconnect = ({ roomName, error }: RoomErrorEventArgs) => {
console.log("[Disconnect]ERROR: ", error);
};
const _onRoomDidFailToConnect = (error: RoomErrorEventArgs) => {
console.log("[FailToConnect]ERROR: ", error);
};
return (
{status === "disconnected" && (
Test a token
<TextInput
style={styles.input}
autoCapitalize="none"
value={token}
onChangeText={(text) => setToken(text)}
>
)}
);
};`
The text was updated successfully, but these errors were encountered: