polite-oil-10264
09/24/2025, 11:54 PMtall-airline-16756
09/24/2025, 11:54 PMtall-airline-16756
09/24/2025, 11:55 PMgetProcessor() method on your LocalVideoTrack instance. If there's a processor attached, it will return the processor object; if not, it will return undefined.
const processor = localVideoTrack.getProcessor();
if (processor) {
console.log("Track has a processor:", processor);
} else {
console.log("Track does not have a processor");
}
• Flutter SDK: Just take a look at the processor field of your LocalVideoTrack. If it's not null, that means a processor is attached.
if (localVideoTrack.processor != null) {
print("Track has a processor");
} else {
print("Track does not have a processor");
}
• Swift SDK: Check the processor property of your LocalVideoTrack. If it’s not nil, then you have a processor attached.
if localVideoTrack.processor != nil {
print("Track has a processor")
} else {
print("Track does not have a processor")
}
If you have any questions or need a hand with anything else, please don’t hesitate to ask. I’m here to help!
Sources: example/sample.ts | lib/src/track/local/local.dart | Sources/LiveKit/Track/Local/LocalVideoTrack.swiftpolite-oil-10264
09/24/2025, 11:56 PMtall-airline-16756
09/24/2025, 11:56 PMLocalVideoTrack in JavaScript using the LiveKit SDK, you can easily use the createLocalVideoTrack() function. This handy function helps you create a video track straight from the user's camera.
Here’s a simple example to guide you:
import { createLocalVideoTrack } from 'livekit-client';
const videoTrack = await createLocalVideoTrack({
resolution: 'h720', // e.g., 1280x720
frameRate: 30,
facingMode: 'user', // for front-facing camera on mobile
});
After you’ve created the track, you can publish it to a room if you want to share the video:
await room.localParticipant.publishTrack(videoTrack);
And when you’re done and no longer need the track, you can simply stop it like this:
videoTrack.stop();
If you have any questions or need a hand with anything else, just let me know—I’m here to help!
Sources: src/room/participant/LocalParticipant.tspolite-oil-10264
09/24/2025, 11:57 PMtall-airline-16756
09/24/2025, 11:58 PMLocalVideoTrack from the local participant using the LiveKit JavaScript SDK, you can easily do this by accessing the trackPublications map on the LocalParticipant. Each track you've published is stored there, so you can grab your video track by its source.
Here's a simple example to get your camera track:
const publication = localParticipant.getTrackPublication(Track.Source.Camera);
if (publication && publication.track) {
const videoTrack = publication.track; // This is your LocalVideoTrack
}
If anything feels unclear or you'd like me to walk you through it step-by-step, just let me know—I'm here to help!
Sources: src/room/participant/LocalParticipant.ts