Git Product home page Git Product logo

react-native-true-sight's Introduction

React Native True Sight

A cross-platform video player with customizable controls.


This library provide a fully customisable video player that work both on Android and iOS. It also come with common use case documentation of things that you would like to implements.

By default there are two commands bar that are displayed respectively on different part of the parent container:

  • Middle. Contain by default a grid display two buttons:
    • One with play / pause alternating.
    • Another that will restart the video.
  • Bottom. Contain the video current time, a progress bar and the total duration.
  • Loader. There is also a loader that will trigger while video is charging (network issues, bootstraping, ...).

Documentation

Quick documentation

This is simple as that.

VideoPlayer accept the following props.

  • source - An object with a key uri which is an url that target the MP4 file. Or directly a reference from a video on file system.
  • autoStart - Whether or not the video should start when rendered (Default to true).
  • onError - A callback that will be called when an error occured, if the resource is not reachable for example.
  • onProgress - A callback called each time the cursor advance in the video, receiving an object as following:
    • currentTime - The current time in seconds.
    • playableDuration - The playable duration in seconds, dependings on the buffer load.
    • maximumDuration - The maximum duration of the video in seconds.
  • onEnd - A callback that will be called when the video reach the end.

For advanced configuration, such as infinite loop, check the rest of the documentation and custom controls bar.

import PropTypes from "prop-types";
import React, { Component } from "react";
import { View } from "react-native";
import VideoPlayer from "react-native-true-sight";

export default class HomeScreen extends Component {
  render() {
    return (
      <View style={{ flex: 1, backgroundColor: "black" }}>
        <VideoPlayer source={{ uri: "https://somevideo.mp4" }} />
      </View>
    );
  }
}

react-native-true-sight's People

Contributors

screamz 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.