【问题标题】:Agora.io video streaming cuts the video on portrait and landscapeAgora.io 视频流切割纵向和横向视频
【发布时间】:2020-04-17 17:31:14
【问题描述】:

我正在使用 React Native 实现 agora.io,但在视频流上,接收器无法在移动旋转时获得完整的视频,例如纵向部分视频丢失,横向部分视频丢失。我想要像 YouTube 上的视频一样的视频流,在纵向模式下,视频适合纵向,而在横向上,视频适合横向。

const config = {
  //Setting config of the app


  appid: '********', //streamer app appId
  channelProfile: 1, //Set channel profile as 0 for RTC
  clientRole: 2,
  videoEncoderConfig: {
    //Set Video feed encoder settings
    width: 720,
    height: 1600,
    bitrate: 1,
    frameRate: FPS30,
    orientationMode: Adaptative,
    swapWidthAndHeight: true,
  },

  audioProfile: AudioProfileDefault,
  audioScenario: AudioScenarioDefault,
};

【问题讨论】:

    标签: react-native video-streaming agora.io


    【解决方案1】:

    您使用的视频渲染模式似乎是hidden,而不是fit

    要使用渲染模式fit,你可以有一个类似的 AgoraView 组件设置:

    import { AgoraViewMode } from 'react-native-agora';
    
    <AgoraView mode={AgoraViewMode.FIT} {...otherProps} />
    

    参考资料:

    https://agora-rn-uikit.netlify.app/docs/api/classes/_agoraview_native_.agoraview

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-11
      • 1970-01-01
      相关资源
      最近更新 更多