devopvoid / webrtc-java

WebRTC for desktop platforms running Java
Apache License 2.0
248 stars 60 forks source link

VideoTrack is not getting invoked on windows #145

Open SFX123456 opened 3 weeks ago

SFX123456 commented 3 weeks ago

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());