Skip to content

RupaPlayerProps

Copy as Markdown

The props of <RupaPlayer>: the file’s, and any prop of the div it renders (className, style, id, …). A change of src, markup, integrity or cloak destroys the player and loads again.

  • Omit<HTMLAttributes<HTMLDivElement>, "onError">

readonly optional cloak?: boolean

Hides the div until the file’s CSS is installed, or the load failed.


readonly optional integrity?: string

The file’s sha256-<base64> hash, checked before the file is read.


readonly optional markup?: MarkupChoice

keep (default): the children are the markup (written in JSX or rendered on the server) and stay React’s. auto, replace: the file’s markup is written into the div and the children are not rendered (React never touches what the player wrote; the development build warns when children are given).


readonly optional onError?: (error) => void

Called with the load’s error (error.code, see FileErrorCode); the div is left as it was. One that throws is reported to the page (reportError).

FileError

void


readonly optional onReady?: (player) => void

Called with the player once the file is mounted (the latest onReady rendered is the one called). One that throws is reported to the page (reportError).

Player

void


readonly src: FileSource

The .rupaplay file: a URL (a URL is compared by its href, so one made at each render loads once), or what mountFile takes (a Blob, bytes, a Response, a file already parsed).