zoukankan      html  css  js  c++  java
  • react-native 视频播放器(很不错哦)

    第一步:
    npm i -S react-native-af-video-player(安装前:先安装: react-native-video、react-native-keep-awake、react-native-vector-icons、react-native-orientation、react-native-linear-gradient
    第二步:
    react-native link react-native-video
    react-native link react-native-keep-awake
    react-native link react-native-vector-icons
    react-native link react-native-orientation
    react-native link react-native-linear-gradient

    具体实现:
    import React from 'react'
    import { AppRegistry, StyleSheet, View } from 'react-native'
    import Video from 'react-native-af-video-player'
    const styles = StyleSheet.create({
    container: {
      flex: 1,
      justifyContent: 'center',
      alignItems: "center"
    },
    videocontent: {
       1000,
      height: 660
    },
    })
    const url = 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
     
    export default class VideoExample extends React.Component {
    render() {
      return (
      <View style={styles.container}>
        <Video
        autoPlay={true}
        loop={true}
        style={styles.videocontent}
        fullScreenOnly={false}
        inlineOnly={true}
        url={url} />
      </View>
      )
      }
    }
     
    实现效果图:
     
     
    其他设置参考:https://github.com/abbasfreestyle/react-native-af-video-player
  • 相关阅读:
    《将博客搬至CSDN》
    Ubuntu 安装 maven
    Ubuntu jdk1.8安装
    spring整合jms
    jms入门
    MySQL 3306端口开启
    黑窗口下mysql导出导入数据库
    PHP 爬虫体验(三)
    解决nvm安装的node使用sudo npm报错的问题
    PHP 爬虫体验(二)
  • 原文地址:https://www.cnblogs.com/candyzhmm/p/9097334.html
Copyright © 2011-2022 走看看