Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 712 Bytes

File metadata and controls

27 lines (19 loc) · 712 Bytes

影片檔播放

套件

react-native-video : https://github.com/react-native-community/react-native-video

安裝方法

yarn add react-native-video
react-native link react-native-video

使用方式

import Video from 'react-native-video';

<Video source={{uri: "video-path"}}   // Can be a URL or a local file.
       ref={(ref) => {
         this.player = ref
       }}                                      // Store reference
       onBuffer={this.onBuffer}                // Callback when remote video is buffering
       onError={this.videoError}               // Callback when video cannot be loaded
/>