我正在研究反应原生视频会议模块。我在右下角的小屏幕上显示远程视频全屏和自我视频的完整视图,样式是,
remoteView: {
flex:1,
justifyContent: 'center',
alignItems: 'center',
alignSelf:'center',
width: width,
height: height,
},
selfView: {
width:width*.2,
height:height*.2,
right: 5,
bottom: 5,
position: 'absolute',
},
我的代码,
return (
<View style={styles.mainContainer}>
{
mapHash(this.state.remoteList, function(remote, index)
return (<RTCView key={remoteIndex} streamURL={remoteStreamURL} style={styles.remoteView} />);
})
}
<RTCView streamURL={this.state.selfViewSrc} style={styles.selfView}/>
<TouchableHighlight
style={styles.otherScreen}
onPress={this._openOtherScreen}>
{
(Platform.OS === 'android')
?
<Image style={styles.iconnav} source= require('./img/imageP.png')}/>
:
<Image style={styles.iconnav} source= require('image!imageP')}/>
}
</TouchableHighlight>
<TouchableHighlight
style={styles.quit}
onPress={ () => this.closeEvent()
}>
{
(Platform.OS === 'android') ?
<Image
style={styles.iconnav}
source={require('./img/exit.png')}/>
:
<Image
style={styles.iconnav}
source={require('image!exit')} />
}
</TouchableHighlight>
</View>
);
我的 mainContainer 风格是,
mainContainer: {
flex:1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
alignSelf : 'stretch',
right: 0,
bottom: 0,
top:0,
left:0,
position: 'absolute',
backgroundColor:'#424242',
},
现在的情况是当我打开其他屏幕并返回视频视图屏幕时,我的远程视图正确显示我,但我的自我视频视图没有显示。但是显示正确位置的图标(注意:我在iOS
设备中运行相同的代码,但它不能正常工作android
)。我运行一个测试用例,我制作了一小帧远程视频,然后当我回到其他屏幕时,我的自我视频显示在其位置上时再次运行我的应用程序。这意味着在完整的远程视频中它也显示,但自视频视图返回到远程视频。如何将我的自我视频放在前面。