Skip to content

⭐ NEW: Modern Headless UI Library for Media Player (Shaka Player & HTML5) in React

License

Notifications You must be signed in to change notification settings

wevertoonsilva/limeplay

 
 

Repository files navigation

🔰 Build Bullet Proof & Stunning Media Players at Ease

Bundle Size MIT License NPM Downloads Github Stars Discord

Limeplay logo

Limeplay is a React based Headless UI library made to work with HTML5 & Shaka Player that allows you to build stunning, accessible and modern looking Media Players with ease. It exposes several hooks and highly configurable components using which you can build any functional Media Player like Netflix, Youtube, Hulu, Hotstar, without having to worry about the underlying player logic while adhering to accessibility best practices.

🚧 This project is still in its early stages and is looking for contributors 🚧

🏗️ This project is under Heavy Development, Things might change anytime! 🏗️


Table of contents

Documentation

👉 It's the https://docs.limeplay.me website for the latest version of Limeplay.

Installation

To use Limeplay UI components, all you need to do is install the @limeplay/core package and its peer dependencies:

$ yarn add @limeplay/core @limeplay/shaka-player

# or

$ npm i @limeplay/core @limeplay/shaka-player

Usage

To start using the components, please follow these steps:

  1. Player Setup
import { useShakaPlayer } from "@limeplay/shaka-player";
import { LimeplayProvider, OverlayOutlet, MediaOutlet } from "@limeplay/core";

export default function Player() {
	const createPlayer = useShakaPlayer();

	return (
		<LimeplayProvider>
			<OverlayOutlet createPlayer={createPlayer}>
				<PlayerOverlay /> {/* Your custom overlay component */}
			</OverlayOutlet>
			<MediaOutlet>
				<video controls={false} playsInline autoPlay={false} />
			</MediaOutlet>
		</LimeplayProvider>
	);
}
  1. Configure Playback and Controls Overlay
import { useLimeplayStore, useLimeplayStoreAPI } from "@limeplay/core";
import { useEffect } from "react";

export default function PlayerOverlay() {
	const playback = useLimeplayStore((state) => state.playback);
	const player = useLimeplayStore((state) => state.player);
	const demoPlabackUrl =
		"https://storage.googleapis.com/nodejs-streaming.appspot.com/uploads/f6b7c492-e78f-4b26-b95f-81ea8ca21a18/1642708128072/manifest.mpd";

	useEffect(() => {
		if (player && player.getLoadMode() === 1) {
			const playerConfig = player.getConfiguration();

			player.load(demoPlabackUrl);
		}
	}, [player, playback]);

	return (
		<div className={classes.overlayWrapper}>
			<ControlsOverlay /> {/* Your custom controls component */}
		</div>
	);
}

Support & Discussion

More guides on how to get started are available here For issues, discussion, and support, please join our Discord Server.

Contributing

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © WINOFFRG

About

⭐ NEW: Modern Headless UI Library for Media Player (Shaka Player & HTML5) in React

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.9%
  • MDX 1.3%
  • JavaScript 0.8%