Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

React-Native play video using expo sdk

$
0
0

I want to play a video from url using expo sdk for react native.I read the sdk but I am unable to understand how to make it work. Here is link for expo sdk video docs.

Here is my code

 import React from 'react';
import { StyleSheet, Text, View,Button } from 'react-native';
import { Video } from 'expo';

export default class App extends React.Component {
    _handleVideoRef = component => {

    }

    onPlayPressed(){

    }

  render() {

    return (
      <View style={styles.container}>
            <Expo.Video
            source = {{uri :'url for video'}}
            ref={this._handleVideoRef}

            />
            <Text>Open up App.js to start working on your app! </Text>
            <Button onPress={this.onPlayPressed.bind(this)} title = "Play"/>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

Doc says video tag works as inline but I am not sure why it not playing video or anything more is needed.

Thanks for any help


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>