Giter Site home page Giter Site logo

harishjangra / lion-player Goto Github PK

View Code? Open in Web Editor NEW

This project forked from git-ced/lion-player

0.0 1.0 0.0 1.51 MB

Lion Player - open-source React video player powered by VideoJS

Home Page: https://lion-player.netlify.app/

License: MIT License

JavaScript 2.37% TypeScript 12.05% HTML 0.49% CSS 85.09%

lion-player's Introduction

lion-player

Open-source React video player powered by VideoJS

NPM npm bundle size (scoped) npm bundle size (scoped version) Libraries.io dependency status for latest release, scoped npm package NPM

Table of Contents

Installation

This library is available through the npm registry.

NPM

$ npm -i lion-player

Yarn

$ yarn add lion-player

Setup

Start using it by importing the library first.

CommonJS

const LionPlayer = require('lion-player');

or

ES6

import { LionPlayer } from 'lion-player';

The LionPlayer component requires the following CSS for styling:

Using link tags

<link href="https://unpkg.com/[email protected]/dist/lion-skin.min.css" rel="stylesheet">

Using import

import 'lion-player/dist/lion-skin.min.css';

Usage

Video playback through Lion Player

import { LionPlayer } from 'lion-player';

const SOURCES = [
  {
    src: 'https://bitmovin-a.akamaihd.net/content/playhouse-vr/m3u8s/105560.m3u8',
    type: 'application/x-mpegURL',
  },
  {
    src: 'https://bitmovin-a.akamaihd.net/content/playhouse-vr/mpds/105560.mpd',
    type: 'application/dash+xml',
  }
];

export default function Player() {
  return (
    <LionPlayer sources={SOURCES} autoplay="muted" />
  );
}

Uncontrolled Lion Player

import { UncontrolledLionPlayer, usePlayer } from 'lion-player';

const SOURCES = [
  {
    src: 'https://bitmovin-a.akamaihd.net/content/playhouse-vr/m3u8s/105560.m3u8',
    type: 'application/x-mpegURL',
  },
  {
    src: 'https://bitmovin-a.akamaihd.net/content/playhouse-vr/mpds/105560.mpd',
    type: 'application/dash+xml',
  }
];

export default function Player() {
  const { ref } = usePlayer({ 
    sources: SOURCES,
    muted: true,
  });

  return (
    <UncontrolledLionPlayer playerRef={SOURCES} />
  );
}

List of possible props for LionPlayer

LionPlayer Props Reference

interface Props {
  aspectRatio?: string;
  autoplay?: boolean | string;
  bigPlayButton?: boolean;
  controlBar?: videojs.ControlBarOptions | false;
  textTrackSettings?: videojs.TextTrackSettingsOptions;
  controls?: boolean;
  defaultVolume?: number;
  fluid?: boolean;
  height?: number;
  html5?: any;
  inactivityTimeout?: number;
  language?: string;
  languages?: { [code: string]: videojs.LanguageTranslations };
  liveui?: boolean;
  loop?: boolean;
  muted?: boolean;
  nativeControlsForTouch?: boolean;
  notSupportedMessage?: string;
  playbackRates?: number[];
  plugins?: Partial<VideoJsPlayerPluginOptions>;
  poster?: string;
  preload?: string;
  sourceOrder?: boolean;
  sources?: videojs.Tech.SourceObject[];
  src?: string;
  techOrder?: string[];
  tracks?: videojs.TextTrackOptions[];
  userActions?: videojs.UserActions;
  width?: number;
}

Authors

See also the list of contributors who participated in this project.

Changelog

Changelog

License

MIT

lion-player's People

Contributors

git-ced avatar

Watchers

 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.