react native在我的本机应用程序中不显示视频,这有什么解决方案?

时间:2019-09-20 10:59:47

标签: react-native

react native da模拟器出现空白页面,不显示视频,我怎么看我的视频? react native da emulator出现空白页面,不显示视频,我怎么看我的视频?

CREATE TABLE production.brands2 (
    brand_id INT IDENTITY (1, 1) PRIMARY KEY,
    brand_name VARCHAR (255) NOT NULL
);

1 个答案:

答案 0 :(得分:1)

首先您导出默认的两件事,这是错误的。运行以下代码即可正常工作

import React, { Component } from 'react';
import Video from 'react-native-video';

import { Text, View, StyleSheet } from 'react-native';


const styles = StyleSheet.create({
  videoContainer: {
    flex: 1,

  },
  video: {
    flex: 1,
  }

});

export default class HelloWorldApp extends Component {
  render() {
    return (
      <View style={styles.videoContainer}>
        <Video
          source={{ uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4' }}
          ref={(ref) => {
            this._player = ref
          }}

          style={styles.video} />
      </View>

    );
  }
}