All Projects → goblin-laboratory → reactjs-player

goblin-laboratory / reactjs-player

Licence: other
基于 react hooks 的 video 播放组件,结构简单,代码简洁,扩展方便。

Programming Languages

javascript
184084 projects - #8 most used programming language
Less
1899 projects
CSS
56736 projects
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to reactjs-player

use-scroll-direction
A simple, performant, and cross-browser hook for detecting scroll direction in your next react app.
Stars: ✭ 24 (-25%)
Mutual labels:  hooks
statery
Surprise-Free State Management! Designed for React with functional components, but can also be used with other frameworks (or no framework at all.)
Stars: ✭ 28 (-12.5%)
Mutual labels:  hooks
react-supabase
React Hooks library for Supabase
Stars: ✭ 168 (+425%)
Mutual labels:  hooks
use-redux-hook
A simple react hook to get access to redux store
Stars: ✭ 13 (-59.37%)
Mutual labels:  hooks
no-redux
⚛️ 🎣 Experimenting with using hooks and context instead of Redux
Stars: ✭ 79 (+146.88%)
Mutual labels:  hooks
react-use-redux
Alternative Redux bindings with upcoming React hooks
Stars: ✭ 31 (-3.12%)
Mutual labels:  hooks
Simplified-JNA
Multi-threaded JNA hooks and simplified library access to window/key/mouse functions.
Stars: ✭ 30 (-6.25%)
Mutual labels:  hooks
use-elapsed-time
React hook to measure elapsed time using requestAnimationFrame
Stars: ✭ 42 (+31.25%)
Mutual labels:  hooks
roover
🐱 A lightweight audio library for React apps.
Stars: ✭ 70 (+118.75%)
Mutual labels:  hooks
use-detect-print
A react hook to detect when a page is being printed
Stars: ✭ 55 (+71.88%)
Mutual labels:  hooks
jedisdb
redis like key-value state management solution for React
Stars: ✭ 13 (-59.37%)
Mutual labels:  hooks
angulareact
A way to seamlessly integrate React and AngularJS
Stars: ✭ 17 (-46.87%)
Mutual labels:  hooks
scala-basic-skeleton
Starting point if you want to bootstrap a project in Scala
Stars: ✭ 16 (-50%)
Mutual labels:  hooks
stook
A minimalist design state management library for React.
Stars: ✭ 86 (+168.75%)
Mutual labels:  hooks
husky-elixir
🐶 Git hooks made easy
Stars: ✭ 47 (+46.88%)
Mutual labels:  hooks
react-zeno
The React companion to Zeno, a Redux implementation optimized for Typescript.
Stars: ✭ 14 (-56.25%)
Mutual labels:  hooks
snake-design
🐍 a react component library based React hooks
Stars: ✭ 33 (+3.13%)
Mutual labels:  hooks
react-hook-sticky
react hook sticky
Stars: ✭ 19 (-40.62%)
Mutual labels:  hooks
transition-hook
☄️ An extremely light-weight react transition animation hook which is simpler and easier to use than react-transition-group
Stars: ✭ 250 (+681.25%)
Mutual labels:  hooks
react-use-observer
Performant react hooks for WebApi Observers, useResizeObserver, useInteractionObserver, useMutationObserver
Stars: ✭ 19 (-40.62%)
Mutual labels:  hooks

ReactjsPlayer

ReactjsPlayer

npm reactjs-player Travis (.org) Coveralls github

基于 react hooks 的 video 播放组件,结构简单,代码简洁,扩展方便。

特点

ReactjsPlayer 遵循 少即是多(Less is more) 的设计原则,具有以下特点:

  • 结构简单:使用 react hooks 做状态管理,将不同的状态拆分到不同的 react custom hooks 中,ReactjsPlayer 中进行组合

  • 扩展方便:扩展时实现对应的 react custom hooks 并在 ReactjsPlayer 中根据条件进行加载

  • 代码简洁:只做播放器内部的状态管理和控制栏显示与控制

  • 理解容易: ReactjsPlayer 事件基于 vidoe 媒体事件 进行扩展,减小理解成本

  • 接口统一:ReactjsPlayerGrindPlayer 封装了统一的状态和方法,并通过 ReactPlayerContext 导出

  • 使用相对复杂:不同于其他的 h5 播放器,ReactjsPlayer 将控制权交给使用者,无法做到一行代码播放所有兼容的格式

Getting started

git clone https://github.com/goblin-laboratory/reactjs-player.git
cd reactjs-player
yarn install
cd packages/reactjs-player/
yarn start
cd packages/reactjs-player-demo/
yarn start

Usage

Demo page: https://goblin-laboratory.github.io/reactjs-player/

npm install reactjs-player --save
# or
yarn add reactjs-player
import React, { Component } from 'react';
import ReactjsPlayer from 'reactjs-player';

const App = () => {
  return <ReactjsPlayer kernel="hlsjs" src="https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8" />;
};

常用场景见说明文档:Usage.md

API

见 API 说明文档:API.md

注意事项

  1. reactjs-player positionabsolute , 大小和位置依赖相对于 static 定位以外的第一个父元素,建议将父节点 position 设置为 relative,通过控制父节点的大小和位置来控制 reactjs-player 的布局结果,可以参考 demo 中的实现

  2. GrindPlayer 必须要大于 400x300 才能正常播放,请保证播放区域不小于 400x300,否则画面会出现显示不全的情况

Supported media

  • HLS
  • FLV
  • RTMP

Contributing

非常欢迎你的贡献,你可以通过以下方式和我们一起共建 😃

  • 通过 Issue 报告 bug 或进行咨询。
  • 提交 Pull Request 。

Licensing

ReactjsPlayer is MIT licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].