Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, {Component} from 'react';
- import {Dimensions, Text, View} from "react-native"
- import Video from "react-native-video";
- const {height, width} = Dimensions.get("window")
- const videoHeight = height / 1.8;
- const videoWidth = width;
- class VideoDemo extends Component {
- constructor(props) {
- super(props);
- this.state = {
- paused: true,
- }
- }
- render() {
- const {videoURL} = this.props
- return (
- <View style={{
- height:height - 200, width:width,backgroundColor:"black"
- }}>
- <Video
- paused={this.state.paused}
- source={{uri: videoURL}}
- style={{height: videoHeight, width: videoWidth}}
- resizeMode={'cover'}
- >
- </Video>
- </View>
- );
- }
- playVideo = () => {
- this.setState({
- paused: false
- })
- }
- pausedVideo = () => {
- this.setState({
- paused: true
- })
- }
- }
- export default VideoDemo;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement