RTCView audio not play

34 views Asked by At

I receive video and audio track with rtc connection, and play thair with <RTCView>. Video is playing but audio is not.

Here's my code:

<FlatList
     data={clients}
     keyExtractor={(item) => item}
     renderItem={({item, index }: any) => {
         let stream: MediaStream = new                 
MediaStream(peerMediaElements.current[clients[index]]?.srcObject?._tracks)
          
    return (
        <View style={{backgroundColor: '#999', width: 200, height: 200}}>
            {
                 item &&
                   <RTCView
                       ref={instance => {
                          provideMediaRef(item, instance)
                        }}`your text`
                        streamURL={stream?.toURL()}
                        objectFit='cover'
                        style={styles.stream} 
                  />
              }
            </View>
          )
        }}
 />

I expect that audio will also play.

0

There are 0 answers