Please excuse our look. We're just getting started here.

Want to learn more about Twilio Forums? Check out our FAQ page here.

[TwilioVideo] Error on publish track

Hey guys, I have a problem with the video, when I start then pause then start and pause and start again I get the error below

My enabled/disabled video:

const enableVideo = async () => {
if (videoTrackRef.current && videoTrackRef.current.name) return;
let createVideoTrack = await createLocalVideoTrack(getWidthHeight());
createVideoTrack.enable();
if (room.name) {
console.log("enabled: " + createVideoTrack.name);
await room.localParticipant.publishTrack(createVideoTrack, {
priority: "low",
});
}

setVideoTrack(createVideoTrack);

};

const disableVideo = useCallback(async () => {
let createdVideo = videoTrackRef.current;
if (createdVideo && room) {
const localTrackPublication =
room.localParticipant?.unpublishTrack(createdVideo);
room.localParticipant?.emit("trackUnpublished", localTrackPublication);
createdVideo.stop();
setVideoTrack(undefined);
}
}, [videoTrack, videoTrackRef]);

Tagged:

Answers

If this is an emergency, please contact Twilio Support. This is not an official Support channel. https://support.twilio.com/
Have an urgent question?
Please contact Twilio Support. This is not an official Support channel.
Contact Support