React Native Expo 移动应用程序中的 HLS m3u8 直播

问题描述 投票:0回答:1

我需要在 Expo React Native 应用程序中显示实时流媒体视频。我尝试了 expo-video,但如果我没记错的话,它只能播放 mp4 视频而不是实时流。 我不想退出世博会。有没有任何expo库或任何其他方式来播放hls m2u8或rtmp直播?

<Video
      source={{ uri: "http://videostream.teroair.com/hls/VIN1000201000001000/front/index.m3u8"}}
      rate={1.0}
      volume={1.0}
      isMuted={false}
      resizeMode="cover"
      shouldPlay = {true}
      isLooping = {false}
      useNativeControls = {true}
      usePoster = {true}
      onError = {this.handleVideoPlayBackError}
      style={styles.backgroundVideo}
/> 
react-native video stream expo http-live-streaming
1个回答
0
投票

您可以使用Expo-av。这个包播放 hls 流,而且 http 不安全,不会在 React Native expo 应用程序中正常播放。所以你应该考虑将cleartextTrafficPermission设置为true

© www.soinside.com 2019 - 2024. All rights reserved.