mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
chore: use nativewind classes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { VideoRef } from "react-native-video";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { ActivityIndicator, StyleSheet } from "react-native";
|
||||
import { ActivityIndicator } from "react-native";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import Video from "react-native-video";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
@@ -26,13 +26,13 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({ videoUrl }) => {
|
||||
useEffect(() => {
|
||||
const lockOrientation = async () => {
|
||||
await ScreenOrientation.lockAsync(
|
||||
ScreenOrientation.OrientationLock.LANDSCAPE
|
||||
ScreenOrientation.OrientationLock.LANDSCAPE,
|
||||
);
|
||||
};
|
||||
|
||||
const unlockOrientation = async () => {
|
||||
await ScreenOrientation.lockAsync(
|
||||
ScreenOrientation.OrientationLock.PORTRAIT_UP
|
||||
ScreenOrientation.OrientationLock.PORTRAIT_UP,
|
||||
);
|
||||
};
|
||||
|
||||
@@ -67,11 +67,11 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({ videoUrl }) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<SafeAreaView style={styles.container}>
|
||||
<SafeAreaView className="flex-1 items-center justify-center bg-black">
|
||||
<Video
|
||||
ref={videoPlayer}
|
||||
source={{ uri: videoUrl }}
|
||||
style={styles.fullScreen}
|
||||
className="absolute bottom-0 left-0 right-0 top-0"
|
||||
fullscreen={true}
|
||||
paused={false}
|
||||
controls={true}
|
||||
@@ -82,19 +82,3 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({ videoUrl }) => {
|
||||
</SafeAreaView>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
backgroundColor: "black",
|
||||
},
|
||||
fullScreen: {
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user