小编Seb*_*665的帖子

错误react-native-video:未定义不是对象(评估“RCTVideoInstance.Constants”)

我想在我的应用程序中使用react-native-video。但是,我所做的不起作用:

  1. 我使用创建了一个新项目expo init Project1

  2. 然后我安装了react-native-video:npm install --save react-native-video

  3. 我当时用的是这个:react-native link react-native-video

我目前只有 App.js :

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

export default function App() {
  return (
    <View style={styles.container}>
      <Video source={{uri: './small.mp4'}}   // Can be a URL or a local file.
       ref={(ref) => {
         this.player = ref
       }}                                      // Store reference
       o.nBuffer={this.onBuffer}                // Callback when remote video is buffering
       onError={this.videoError}               // Callback when video cannot be loaded …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-video

5
推荐指数
1
解决办法
7999
查看次数

标签 统计

react-native ×1

react-native-video ×1