I am trying to connect Janus from React Native. Everything works fine , except the remote video is showing as blank
I have checked with the web client and it works fine meaning the Sender is sending the video.
I have also checked the video tracks and the Remote Stream definitely has video tracks.
My Remote feed function is as below
newRemoteFeed = (id, display) => { let remoteFeed = null; var ref = this; janus.attach({ plugin: 'janus.plugin.videoroom', opaqueId: "janusrocks", success: pluginHandle => { remoteFeed = pluginHandle; let listen = { request: 'join', room: 1234, ptype: 'subscriber', feed: id, }; remoteFeed.send({message: listen}); }, error: error => { Alert.alert(' -- Error attaching plugin...', error); }, onmessage: (msg, jsep) => { let event = msg['videoroom']; if (event != undefined && event != null) { if (event === 'attached') { // Subscriber created and attached } } if (jsep !== undefined && jsep !== null) { remoteFeed.createAnswer({ jsep: jsep, media: {audioSend: false, videoSend: false , data:true}, success: jsep => { var body = {request: 'start', room: 1234}; remoteFeed.send({message: body, jsep: jsep}); }, error: error => { Alert.alert('WebRTC error:', error); }, }); } }, webrtcState: on => {}, onlocalstream: stream => {}, onremotestream: stream => { ref.setState(s => ({...s, info: 'One peer join!'})); // const remoteList = ref.state.remoteList; // const remoteListPluginHandle = ref.state.remoteListPluginHandle; // remoteList[id] = stream.toURL(); // remoteListPluginHandle[id] = remoteFeed; //Alert.alert("Friend Joined"); ref.setState(s => ({ ...s, remoteKey: '234', remoteStream: stream.toURL(), })); var videoTracks = stream.getVideoTracks(); if(!videoTracks || videoTracks.length === 0) { Alert.alert("No Remote Video"); } else { Alert.alert("Remote Video Exists")}; }, oncleanup: () => { // if (remoteFeed.spinner !== undefined && remoteFeed.spinner !== null) // remoteFeed.spinner.stop(); // remoteFeed.spinner = null; // if ( // bitrateTimer[remoteFeed.rfindex] !== null && // bitrateTimer[remoteFeed.rfindex] !== null // ) // clearInterval(bitrateTimer[remoteFeed.rfindex]); // bitrateTimer[remoteFeed.rfindex] = null; }, }); }
I am using the RTC vew to show the remote stream
Any help would be deeply appreciated
