mirror of
https://github.com/zoriya/v10.git
synced 2026-08-10 16:09:18 +00:00
33 lines
794 B
JavaScript
33 lines
794 B
JavaScript
"use client";
|
|
import { createMediaButton } from "../create-media-button.js";
|
|
import { selectPlayback } from "@videojs/core/dom";
|
|
import { PlayButtonCore, PlayButtonDataAttrs } from "@videojs/core";
|
|
//#region src/ui/play-button/play-button.tsx
|
|
/**
|
|
* A button that toggles playback.
|
|
*
|
|
* @example
|
|
* ```tsx
|
|
* <PlayButton />
|
|
*
|
|
* <PlayButton
|
|
* render={(props, state) => (
|
|
* <button {...props}>
|
|
* {state.paused ? <PlayIcon /> : <PauseIcon />}
|
|
* </button>
|
|
* )}
|
|
* />
|
|
* ```
|
|
*/
|
|
const PlayButton = createMediaButton({
|
|
displayName: "PlayButton",
|
|
core: PlayButtonCore,
|
|
stateAttrMap: PlayButtonDataAttrs,
|
|
selector: selectPlayback,
|
|
action: (core, state) => core.toggle(state),
|
|
hotkeyAction: "togglePaused"
|
|
});
|
|
//#endregion
|
|
export { PlayButton };
|
|
|
|
//# sourceMappingURL=play-button.js.map
|