RupaPlayerProps
Copy as MarkdownThe 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.
Extends
Section titled “Extends”Omit<HTMLAttributes<HTMLDivElement>,"onError">
Properties
Section titled “Properties”cloak?
Section titled “cloak?”
readonlyoptionalcloak?:boolean
Hides the div until the file’s CSS is installed, or the load failed.
integrity?
Section titled “integrity?”
readonlyoptionalintegrity?:string
The file’s sha256-<base64> hash, checked before the file is read.
markup?
Section titled “markup?”
readonlyoptionalmarkup?: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).
onError?
Section titled “onError?”
readonlyoptionalonError?: (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).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
onReady?
Section titled “onReady?”
readonlyoptionalonReady?: (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).
Parameters
Section titled “Parameters”player
Section titled “player”Returns
Section titled “Returns”void
readonlysrc: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).