0

在 expo-av 中按下视频的全屏按钮后,我需要旋转视频屏幕。我的代码是:

import { StatusBar } from 'expo-status-bar';
import * as React from 'react';
import { View, StyleSheet, Dimensions, } from 'react-native';
import { Video, } from 'expo-av';

const { width, height } = Dimensions.get('window');

export default function Playlist(){
  const video = React.useRef(null);
  const [status, setStatus] = React.useState({});
  return(
    <View style={styles.container}>
       <StatusBar style='light' />
          <View style={styles.containervideo}>
          <Video
          ref={video}
          style={styles.video}
          source={{
            uri: 'http://168.232.157.7:65081/12Apostolos/video.m3u8',
          }}
          useNativeControls={true}
          resizeMode="contain"
          onReadyForDisplay={}
          orientation="ladscape"
          shouldPlay={false}
          isLooping={false}
          onPlaybackStatusUpdate={status => setStatus(() => status)}
        />
          </View>
    </View>
  )
}

如何根据设备方向旋转视频?而且我需要它在按下全屏按钮后立即旋转。

4

0 回答 0