question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with sending audio

See original GitHub issue

In prepareWebrtc function at the end I have the following code:

MediaStreamTrack.getSources(sourceInfos => {
                  var isFront = camera_front
                  console.log(sourceInfos);
                  let videoSourceId;
                  for (const i = 0; i < sourceInfos.length; i++) {
                    const sourceInfo = sourceInfos[i];
                    if(sourceInfo.kind == "video" && sourceInfo.facing == (isFront ? "front" : "back")) {
                      videoSourceId = sourceInfo.id;
                    }
                  }
                  console.log("videoSourceId:" + videoSourceId)
                  getUserMedia({
                    "audio": true,
                    "video":false
                  },  (stream) => {
                    streamsDone(handleId, jsep, media, callbacks, stream)
                  },
                  // TODO: add error handling
                  () => undefined
                  );
              });

When “video” is true for android and when video is {optional: [{sourceId: videoSourceId}] } for ios, audio gets transmitted, however, then I have to ask for camera permissions which I don’t want to do. When I do “video”:false, audio can be received by my app; however, it doesn’t get send.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
paragikjaincommented, May 24, 2020

I am still getting this issue: not able to get audio stream in rtcview please find the code below and help me.

`import React, { Component } from ‘react’; import { StyleSheet, View, Button, Text } from ‘react-native’; import * as mediasoupClient from ‘mediasoup-client’ import {RTCPeerConnection,RTCIceCandidate,RTCSessionDescription,RTCView,MediaStream, MediaStreamTrack,mediaDevices,registerGlobals} from ‘react-native-webrtc’; import io from ‘socket.io-client/dist/socket.io’; registerGlobals() class WebRtcScreen extends Component {

state = { MediaStreamx :new MediaStream() }

componentDidMount(){ navigator.mediaDevices.getUserMedia({video: true, audio: true}) .then(this.handleVideo) .catch(this.videoError)

}

handleVideo = (stream) => { this.setState({MediaStreamx:stream}) }

videoError = (err) => { console.log(err.name) }

render() { return ( <RTCView key={1} zOrder={2} objectFit=‘cover’ style={{ …styles.rtcView }}
streamURL={this.state.MediaStreamx.toURL()}/> ); } } const styles = StyleSheet.create({ rtcView: { width: 100, //dimensions.width, height: 200,//dimensions.height / 2, backgroundColor: ‘black’, }, });

export{WebRtcScreen};`

3reactions
trung1008commented, Jul 13, 2018

i have same issues. Anyone help me to resolve it

Read more comments on GitHub >

github_iconTop Results From Across the Web

11 Ways to Fix WhatsApp Voice Messages Not Working Issue
If there is not enough space, an error will appear that you cannot load the audio. So try to free up some space...
Read more >
How to Fix WhatsApp Not Sending Voice Messages Issue
How to Fix WhatsApp Not Sending Voice Messages Issue · Method 1. Check Network Connection · Method 2. Try WhatsApp Official Version ·...
Read more >
How to Fix It When WhatsApp Voice Messages Aren't Working
You have a volume issue. If your phone or computer's speaker isn't working or is turned too low, you won't be able to...
Read more >
Troubleshoot audio and video issues on your computer or ...
Android: To ensure that audio isn't being sent to the headphone jack, plug headphones in, and then unplug them. If the problem persists, ......
Read more >
WhatsApp Voice Messages Not Working? Here's What To Do
If you're playing voice messages on WhatsApp but don't hear audio output, check that your device's volume isn't low or muted. Increase your ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found