【问题标题】:Expo Camera zoomed video record世博相机变焦视频记录
【发布时间】:2020-12-17 06:25:38
【问题描述】:

我在我的 Android 手机上使用 Expo Camera,返回给我的记录被缩放,在拍摄照片或视频时,相机视图似乎失真。如何将其设置为 false,我尝试使用 react-native-camera 但它崩溃了。

<Camera useCamera2Api={false} 
  ref={(el) => this.camera = el } 
  style={{ flex: 1, 
          flexDirection: 'column', 
          justifyContent: 'space-between', 
          alignItems: 'flex-start' }} 
          flashMode={this.state.flashmode ? Camera.Constants.FlashMode.on : Camera.Constants.FlashMode.off}
          type={this.state.type} 
          useNativeZoom={true}  
          defaultVideoQuality={Camera.Constants.VideoQuality['1080p']} 
          ratio={'16:9'} 
          autoFocus={Camera.Constants.AutoFocus.on}>
</Camera>

我使用 react-native-video 渲染视频:

<Video  source={{ uri: this.state.preview }}
        style={{ flex: 1,  
        width:Dimensions.get('screen').width,
        height:Dimensions.get('screen').height, 
        backgroundColor: '#FFFFFF', zIndex: 0 }} />

我的 react 原生版本是 0.63。

【问题讨论】:

    标签: react-native opengl-es expo


    【解决方案1】:

    Video 组件中有一个名为“resizeMode”的属性。尝试将此道具设置为“覆盖”,如下所示:

     <Video  source={{ uri: this.state.preview }}
        style={{ flex: 1,  
        width:Dimensions.get('screen').width,
        height:Dimensions.get('screen').height, 
        resizeMode={"cover"}
        backgroundColor: '#FFFFFF', zIndex: 0 }} />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-19
      • 2019-11-14
      • 1970-01-01
      • 1970-01-01
      • 2022-07-21
      • 1970-01-01
      • 1970-01-01
      • 2018-07-12
      相关资源
      最近更新 更多