Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 使用react native video时,通过ImagePicker选择的视频不可见_React Native_Uiimagepickercontroller - Fatal编程技术网

React native 使用react native video时,通过ImagePicker选择的视频不可见

React native 使用react native video时,通过ImagePicker选择的视频不可见,react-native,uiimagepickercontroller,React Native,Uiimagepickercontroller,我正在使用react-native ImagePicker和react-native视频包。 我用ImagePicker选择了一个视频,效果非常好 现在我想要的是显示我正在使用的选定视频 对本机视频的反应如下 `<Video source={source} ref={(ref) => { this.player = ref }} rate={1.0} // 0 is

我正在使用react-native ImagePicker和react-native视频包。 我用ImagePicker选择了一个视频,效果非常好

现在我想要的是显示我正在使用的选定视频 对本机视频的反应如下

`<Video source={source}
       ref={(ref) => {
         this.player = ref
       }}
       rate={1.0}                              // 0 is paused, 1 is normal.
       volume={1.0}                            // 0 is muted, 1 is normal.
       muted={false}                           // Mutes the audio entirely.
       paused={false}                          // Pauses playback entirely.
       resizeMode="cover"                      // Fill the whole screen at aspect ratio.*
       repeat={true}                           // Repeat forever.
       playInBackground={false}                // Audio continues to play when app entering background.
       playWhenInactive={false}                // [iOS] Video continues to play when control or notification center are shown.
       ignoreSilentSwitch={"ignore"}           // [iOS] ignore | obey - When 'ignore', audio will still play with the iOS hard silent switch set to silent. When 'obey', audio will toggle with the switch. When not specified, will inherit audio settings as usual.
       progressUpdateInterval={250.0}          // [iOS] Interval to fire onProgress (default to ~250ms)
       onLoadStart={this.loadStart}            // Callback when video starts to load
       onLoad={this.setDuration}               // Callback when video loads
       onProgress={this.setTime}               // Callback every ~250ms with currentTime
       onEnd={this.onEnd}                      // Callback when playback finishes
       onError={this.videoError}               // Callback when video cannot be loaded
       onBuffer={this.onBuffer}                // Callback when remote video is buffering
       onTimedMetadata={this.onTimedMetadata}/>`
我让它工作了。
缺少样式。一旦我把它调好,它就工作得非常好

我更喜欢的是,有时会出现错误“无法读取未定义的常数”,这是因为视频库没有正确链接。在xCode中删除并再次添加,错误将消失

`source = videoUrl.split("file://")[1]`