chore: use nativewind css classes with view instead of safeareaview

This commit is contained in:
Adrian Castro
2024-02-06 10:45:59 +01:00
parent e11dc1dbb2
commit 15f3de83e4

View File

@@ -4,8 +4,7 @@ import type {
TextTracks, TextTracks,
} from "react-native-video"; } from "react-native-video";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { ActivityIndicator, StyleSheet } from "react-native"; import { ActivityIndicator, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import Video, { TextTracksType } from "react-native-video"; import Video, { TextTracksType } from "react-native-video";
import { useLocalSearchParams, useRouter } from "expo-router"; import { useLocalSearchParams, useRouter } from "expo-router";
import * as ScreenOrientation from "expo-screen-orientation"; import * as ScreenOrientation from "expo-screen-orientation";
@@ -142,12 +141,12 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({ data }) => {
}; };
return ( return (
<SafeAreaView style={styles.container}> <View className="flex-1 items-center justify-center bg-black">
<Video <Video
ref={videoRef} ref={videoRef}
source={videoSrc} source={videoSrc}
// textTracks={textTracks} // breaks playback // textTracks={textTracks} // breaks playback
style={styles.fullScreen} className="absolute inset-0"
fullscreen={true} fullscreen={true}
paused={false} paused={false}
controls={true} controls={true}
@@ -155,26 +154,10 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({ data }) => {
onReadyForDisplay={onReadyForDisplay} onReadyForDisplay={onReadyForDisplay}
/> />
{isLoading && <ActivityIndicator size="large" color="#0000ff" />} {isLoading && <ActivityIndicator size="large" color="#0000ff" />}
</SafeAreaView> </View>
); );
}; };
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "black",
},
fullScreen: {
position: "absolute",
top: 0,
left: 0,
bottom: 0,
right: 0,
},
});
interface Caption { interface Caption {
type: "srt" | "vtt"; type: "srt" | "vtt";
id: string; id: string;