【问题标题】:why is react native video not working on android, but working on ios?为什么反应原生视频不能在 android 上运行,但在 ios 上运行?
【发布时间】:2022-07-26 06:57:47
【问题描述】:

已安装 react video v. 5.2.0

但在运行android时出错,但在ios中运行正常。

"react": "17.0.2",
"react-native": "0.68.0",
"react-native-video": "^5.2.0"

App.js App.js

import Video from 'react-native-video';

// create a component
const App = () => {
  return (
    <View>
      <Video
        source={{Uri: 'https://www.w3schools.com/html/mov_bbb.mp4'}}
        ref={ref => (this.player = ref)}
        style={{width: 300, height: 400}}
      />
    </View>
  );
};

请帮忙谢谢。

【问题讨论】:

  • 您也需要在这里分享错误。请注意,视频播放依赖于底层自然平台功能,因此该格式可能在 Android 上受支持,但在 iOS 上不支持。

标签: reactjs video native


【解决方案1】:

uri 参数应为小写(与Uri 相对。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-10-31
    • 2020-05-16
    • 2011-04-24
    • 2021-01-14
    • 2021-03-13
    • 1970-01-01
    • 2020-05-19
    • 2021-06-13
    相关资源
    最近更新 更多