Hello
Underneath is the code that should work in my opinion. It works with audio and datachannels, but video is not working.
I have 1 camera and the camera gets registered fine and also the track.
List captureDevices = MediaDevices.getVideoCaptureDevices();
System.out.println("amojuntof capture devices " + captureDevices.size());
VideoDeviceSource videoDeviceSource = new VideoDeviceSource();
videoDeviceSource.setVideoCaptureDevice(captureDevices.get(0));
System.out.println("created video device source ");
VideoTrack videoTrack = peerConnectionFactory.createVideoTrack("video",(VideoTrackSource) videoDeviceSource);
ArrayList g = new ArrayList<>();
g.add("video");
System.out.println("video set up 1");
videoTrack.addSink(new VideoTrackSink() {
@Override
public void onVideoFrame(VideoFrame videoFrame) {
System.out.println("video frame ");
}
});
videoTrack.setEnabled(true);
System.out.println("is enabled video" + videoTrack.isEnabled());
Hello Underneath is the code that should work in my opinion. It works with audio and datachannels, but video is not working. I have 1 camera and the camera gets registered fine and also the track. List captureDevices = MediaDevices.getVideoCaptureDevices();
System.out.println("amojuntof capture devices " + captureDevices.size());
VideoDeviceSource videoDeviceSource = new VideoDeviceSource();
videoDeviceSource.setVideoCaptureDevice(captureDevices.get(0));
System.out.println("created video device source ");
VideoTrack videoTrack = peerConnectionFactory.createVideoTrack("video",(VideoTrackSource) videoDeviceSource);
ArrayList g = new ArrayList<>();
g.add("video");
System.out.println("video set up 1");
videoTrack.addSink(new VideoTrackSink() {
@Override
public void onVideoFrame(VideoFrame videoFrame) {
System.out.println("video frame ");
}
});
videoTrack.setEnabled(true);
System.out.println("is enabled video" + videoTrack.isEnabled());