2016-07-28 141 views
0

我在RTCView中使用視頻,我想通過另一個視頻顯示一個小視頻。但是我的RTCView並沒有相互重疊。下面是我的代碼React-Native RTC視圖重疊

<RTCView streamURL={this.state.selfViewSrc} style={styles.selfView}/> 
{ 
    mapHash(this.state.remoteList, function(remote, index) { 
    return <RTCView key={index} streamURL={remote} style= {styles.remoteView}/> 
    }) 
} 

CSS爲─

const styles = StyleSheet.create({ 
selfView: { 
    width: width, 
    height: (Platform.OS === 'ios') ? height-80 : height/2+100, 
    alignSelf: 'center', 
    zIndex: 0, 
}, 
remoteView: { 
    position: 'absolute', 
    zIndex: 2, 
    marginTop: (Platform.OS === 'ios') ? -120 : 0, 
    width: 120, 
    height: 120, 
    left: 0, 
    borderWidth: .5, 
    alignSelf: 'flex-start' 
}, 
+0

記住張貼它目前的樣子的截圖? –

回答

0

我已經解決了這個問題,問題是,在這selfview和遠程視窗創建順序,我要創建遠程視圖首先把他們戰勝自我視圖。

謝謝大家!