@cassette/core
v2.0.0-beta.4
Published
A simple, clean, and responsive visual wrapper for the HTML audio tag, built with React.
Downloads
165
Maintainers
Readme
@cassette/core
@cassette/core
provides React Context-based components which expose an API for consuming and updating media player state. The API abstraction maps very closely to the set of actions that would be available to an end user of a conventional media player, while remaining flexible enough to accommodate varying media player design paradigms.
Installation
npm install @cassette/core
Components included:
FullscreenContextConsumer
- used to read and update the state of the surroundingfullscreenContext
FullscreenContextProvider
- wraps an area which should be fullscreen-ablePlayerContextConsumer
- used to read and update the state of the surroundingplayerContext
PlayerContextGroup
- a wrapper which can be used to share configuration among multiple descendantPlayerContextProvider
instances as well as prevent multiple media elements from playing audio simultaneouslyPlayerContextProvider
- wraps an area which shares a commonplayerContext
Higher-order components included:
playerContextFilter
- consumes the surroundingfullscreenContext
andplayerContext
and passes only a specified subset of the context, as well as any additional props, to the given child component