All Projects → zhihu → Griffith

zhihu / Griffith

Licence: mit
A React-based web video player

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to Griffith

Xgplayer
A HTML5 video player with a parser that saves traffic
Stars: ✭ 4,792 (+109.53%)
Mutual labels:  mp4, html5-video, hls, mp4box, html5-video-player, fmp4
Mediaelement
HTML5 <audio> or <video> player with support for MP4, WebM, and MP3 as well as HLS, Dash, YouTube, Facebook, SoundCloud and others with a common HTML5 MediaElement API, enabling a consistent UI in all browsers.
Stars: ✭ 7,767 (+239.62%)
Mutual labels:  mp4, html5-video, hls, html5-video-player
Chimee
a video player framework aims to bring wonderful experience on browser
Stars: ✭ 2,332 (+1.97%)
Mutual labels:  mp4, html5-video, hls, html5-video-player
Clappr
🎬 An extensible media player for the web.
Stars: ✭ 5,436 (+137.69%)
Mutual labels:  mp4, html5-video, hls, html5-video-player
clappr-core
Core components of the Clappr player architecture
Stars: ✭ 41 (-98.21%)
Mutual labels:  mp4, html5-video, html5-video-player
Magicalexoplayer
The Easiest Way To Play/Stream Video And Audio Using Google ExoPlayer In Your Android Application
Stars: ✭ 171 (-92.52%)
Mutual labels:  mp4, hls
Ffmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
Stars: ✭ 27,382 (+1097.29%)
Mutual labels:  mp4, hls
Video.js
Video.js - open source HTML5 & Flash video player
Stars: ✭ 32,478 (+1320.11%)
Mutual labels:  html5-video, hls
Shinobi
☮️ 🇵🇸 Shinobi CE - The Free Open Source CCTV platform written in Node.JS (Camera Recorder - Security Surveillance Software - Restreamer
Stars: ✭ 1,099 (-51.95%)
Mutual labels:  mp4, hls
Mediaelement Plugins
Plugins for the main mediaelement project
Stars: ✭ 328 (-85.66%)
Mutual labels:  html5-video, hls
Node Media Server
Node.js Media Server / VOD / HLS / DRM
Stars: ✭ 49 (-97.86%)
Mutual labels:  mp4, hls
Indigo Player
Highly extensible, modern, JavaScript video player. Handles MPEG-Dash / HLS / MPEG-4 and is built on top of the HTML5 video element.
Stars: ✭ 1,173 (-48.71%)
Mutual labels:  html5-video, hls
Gpac
Modular Multimedia framework for packaging, streaming and playing your favorite content.
Stars: ✭ 1,321 (-42.24%)
Mutual labels:  mp4, hls
Awesome Video
A curated list of awesome streaming video tools, frameworks, libraries, and learning resources.
Stars: ✭ 397 (-82.64%)
Mutual labels:  mp4, hls
Mediaelement Files
Sample media files (MP4, WebM, Ogv, MP3, etc.) for the MediaElement.js library
Stars: ✭ 92 (-95.98%)
Mutual labels:  mp4, hls
Media Server
RTSP/RTP/RTMP/FLV/HLS/MPEG-TS/MPEG-PS/MPEG-DASH/MP4/fMP4/MKV/WebM
Stars: ✭ 1,363 (-40.4%)
Mutual labels:  mp4, hls
Webxdownloader
Browser extension to download Webex meeting recordings
Stars: ✭ 52 (-97.73%)
Mutual labels:  mp4, hls
Html5 Dash Hls Rtmp
🌻 HTML5播放器、M3U8直播/点播、RTMP直播、低延迟、推流/播流地址鉴权
Stars: ✭ 1,805 (-21.08%)
Mutual labels:  html5-video, hls
Node Video Lib
Node.js Video Library / MP4 & FLV parser / MP4 builder / HLS muxer
Stars: ✭ 264 (-88.46%)
Mutual labels:  mp4, hls
Zlmediakit
WebRTC/RTSP/RTMP/HTTP/HLS/HTTP-FLV/WebSocket-FLV/HTTP-TS/HTTP-fMP4/WebSocket-TS/WebSocket-fMP4/GB28181 server and client framework based on C++11
Stars: ✭ 5,248 (+129.47%)
Mutual labels:  mp4, hls

A React-based Web video player

License npm package Coverage Status Code style PRs Welcome

English | 简体中文 | 日本語

Introduction

  • Streaming: Griffith makes streaming easy. Whether your video format is mp4 or hls, Griffith can use Media Source Extension (MSE) for segment loading.
  • Extensibility: Griffith makes it simple to support video features in React apps. It also supports the UMD (Universal Module Definition) patterns for direct use in the browser if your application is not based on React.
  • Reliability: Griffith has been widely used in the web and mobile web of Zhihu.

Usage

React application

yarn add griffith
import Player from 'griffith'

const sources = {
  hd: {
    play_url: 'https://zhstatic.zhihu.com/cfe/griffith/zhihu2018_hd.mp4',
  },
  sd: {
    play_url: 'https://zhstatic.zhihu.com/cfe/griffith/zhihu2018_sd.mp4',
  },
}

render(<Player sources={sources} />)

Detailed usage

Note: Griffith is not supporting SSR application

non-React application

<script src="https://unpkg.com/griffith-standalone/dist/index.umd.min.js"></script>
const sources = {
  hd: {
    play_url: 'https://zhstatic.zhihu.com/cfe/griffith/zhihu2018_hd.mp4',
  },
  sd: {
    play_url: 'https://zhstatic.zhihu.com/cfe/griffith/zhihu2018_sd.mp4',
  },
}

Griffith.createPlayer(element).render({sources})

Standalone mode detailed usage

Project Structure

Griffith is a Monorepo and uses Yarn workspace and Lerna.

Core

  • packages/griffith: The core library

Utilities

  • packages/griffith-message: Helpers for cross-window message
  • packages/griffith-utils: Utilities

Plugins

Others

  • example: example and demos
  • packages/griffith-standalone: A UMD build that can be used without React or Webpack

Custom Build

Build tools like webpack include griffith-mp4 and griffith-hls by default. You can make your bundle smaller by injecting aliases at build-time.

If you use webpack, do so with resolve.alias:

// webpack v5+
module.exports = {
  resolve: {
    alias: {
      'griffith-hls': false,
      'griffith-mp4': false,
    },
  },
}

// webpack v4
module.exports = {
  resolve: {
    alias: {
      'griffith-hls': 'griffith/null',
      'griffith-mp4': 'griffith/null',
    },
  },
}

Note that without griffith-mp4 / griffith-hls Griffith can no longer play MP4 / HLS media unless the browser supports it natively.

Contributing

Read below to learn how you can take part in improving Griffith.

Contributing Guide

Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Griffith.

Contributor

LICENSE

MIT

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