Im使用react-native-video和react-native。我需要在较低的Android版本Android 4.4(API 19)kitkat上安装并运行此程序。
但是我只能在Android 4.4(API 19)上播放视频时黑屏。不知道发生了什么。在Android 9(API 28)
上可以正常工作Android 4.4上不支持该库吗?
const App = () => {
return (
<Fragment>
<View>
<Video
source={require('./assets/backgroundVideo.mp4')}
ref={(ref) => {
this.player = ref
}}
onBuffer={this.onBuffer}
onError={this.videoError}
style={styles.backgroundVideo} />
</View>
</Fragment>
);
};
UPDATE:我在使用mediaplayer库的Android Studio中也遇到了相同的错误。
我阅读了此https://developer.android.com/guide/topics/media/media-formats,因此我将编码中的配置文件从H.264 AVC主配置文件更改为H.264 AVC基准配置文件(BP)。但是没有区别。
通过Android Studio在模拟器上进行即时通讯测试。我没有那个操作系统的设备。 Android 4.4 Version.api:19(Google API)和分辨率1920 x 1080
根据exoplayer网站,如果您使用的是模拟器,则至少需要使用api版本23。