1

我开发了带有视频播放器的移动应用程序反应原生。
然后我从 react native 项目构建了 Android 和 iOS 应用程序。
但它在 Android 中运行良好,但在 iOS 中无法播放。
如果你曾经遇到过这个问题,请帮助我。

这是代码和包信息。

<WebView 
    allowsFullscreenVideo={true} 
    style={{ aspectRatio: 1.6, backgroundColor: "#000000", flex: 1 }}
    source={{ uri: 'https://sample.mp4' }}                    
/>

"react": "16.9.0",
"react-native": "0.61.5",
"react-native-webview": "^8.0.3",
4

1 回答 1

2

此代码适用于androidios

<View style={{ height: 300 }}>
      <WebView
      style={{flex: 1.0}}
      javaScriptEnabled={true}
      domStorageEnabled={true}
      source={{uri: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4' }}/>
</View>
于 2020-02-29T12:21:27.220 回答