Hey, please help meee, i want load a Video from local assets, but i can’t
Here’s the code:
import * as React from "react";
import {
Image,
Platform,
StyleSheet,
Text,
TouchableOpacity,
StatusBar,
Dimensions,
TextInput,
KeyboardAvoidingView,
AsyncStorage,
View,
FlatList,
RefreshControl,
} from "react-native";
import { ScrollView } from "react-native-gesture-handler";
import * as WebBrowser from "expo-web-browser";
import * as Permissions from "expo-permissions";
import { Overlay } from "react-native-elements";
import { Notifications } from "expo";
import ShimmerPlaceHolder from "react-native-shimmer-placeholder";
import { MonoText } from "../components/StyledText";
import { AdMobInterstitial } from "expo-ads-admob";
import { copilot, walkthroughable, CopilotStep } from "react-native-copilot";
import { Video } from "expo-av";
import { Asset } from "expo-asset";
export default class HomeScreen extends React.Component {
constructor() {
super();
this.state = {};
}
componentDidMount = async () => {
const { state, navigate } = this.props.navigation;
const { navigation } = this.props;
};
render() {
return (
<View style={styles.container}>
<View
style={{
height: height,
width: width,
justifyContent: "center",
alignItems: "center",
backgroundColor: "black",
}}
>
<Video
source={require("../assets/images/vids/as.mp4")}
rate={1.0}
volume={1.0}
isMuted={false}
resizeMode="contain"
shouldPlay
useNativeControls
isLooping
style={{ width: width, height: height }}
/>
</View>
</View>
);
}
}
HomeScreen.navigationOptions = {
header: null,
};
export const { width, height } = Dimensions.get("window");
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
},
});
using this code, i got only blank screen
Here’s my asset location:
I followed the following link: https://docs.expo.io/versions/latest/sdk/video/
if i use uri, it’s all good, but i want to load from my internal asset
did I make mistake? Help me