Coder Social home page Coder Social logo

1uokun / react-native-video-bilibili Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 5.0 8.09 MB

📺哔哩哔哩 (゜-゜)つロ 干杯~-bilibili | 一款交互设计参考bilibili的高性能富交互的视频播放器,纯JS基于react-native-video二次开发

Home Page: https://1uokun.github.io/react-native-video-bilibili/index.html

JavaScript 100.00%
expo-av react-native videojs

react-native-video-bilibili's Introduction

react-native-video-bilibili

📺react-native-video二次开发视频播放器,交互设计参考bilibili

No link, no dependencies, only javascript

Install npm version npm version

npm install react-native-video-bilibili

Screenshot

UX exploded view

Preview

Expo SDK 50 Web Online
expo-video-bilibili https://1uokun.github.io/react-native-video-bilibili/index.html

Usage

import Video from 'react-native-video-bilibili';

<Video
    ref={'player'}
    style={{width:"100%",height:300}}
    source={{uri: "https://media.w3.org/2010/05/sintel/trailer.mp4"}}
/>

Configurable props

  • ...video.props

  • containerStyle

    container style

  • style

    react-native-video style

  • styles

    deep merge styles with VideoPlayerStyles

  • lock🔒

    🌟Lock all operations🌟

  • Custom Menus Component

    Property Type Arguments Description
    renderCenterMenus node state,props Components displayed in the middle of the player, like volume or light control
    renderTopMenus node state,props Components displayed in the top of the player, like title or navigation control
    renderBottomMenus node state,props Components displayed in the bottom of the player, like seek bar or seek time control
    renderSeekTime node state,props Components displayed when you slide left and right, like show each frame of picture
    renderLoading node state,props Components displayed when video is buffering, like show buffering loading
    children function state,props ({state,props})=>(<View></View>)
    state props

    Pass all state and external props of the parent component<Provider> to the child component<Consumer> based on context API

    Provider

    <Provider value={{
        state:this.state,
        props:{
            ...this.props,
            onCurrentTimeProgress:this.onCurrentTimeProgress,
            onSlidingComplete:this.onSlidingComplete,
            setPaused:this.setPaused
        },
    }}>
    </Provider>

    Consumer

    <Consumer>
        {({state, props}) =>
            <Animated.View>
                {props.renderCenterMenus(state, props)}
            </Animated.View>
        }
    </Consumer>

Event props

Ref Direct Manipulation

  • ...video methods

       this.player._root.doSth()
  • setPaused()

  • showMenusComponent()

  • showSeekTimerComponent()

  • onOrientationChange({width,height})

Todo-list

1.0

if you accept Link the other library,please refer to https://github.com/abbasfreestyle/react-native-af-video-player

1.1

  • add lock props
  • add children props

2.0 Future features(💰paid version)

  • Native volume control
  • Native light control
  • 弹幕

react-native-video-bilibili's People

Contributors

1uokun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.