started a more proper implementation of the player
This commit is contained in:
parent
d902f19d35
commit
fbc040c317
6 changed files with 231 additions and 50 deletions
15
src/features/player/controls/playState.tsx
Normal file
15
src/features/player/controls/playState.tsx
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { Component, createMemo } from "solid-js";
|
||||
import { useVideo } from "../context";
|
||||
|
||||
export const PlayState: Component<{}> = (props) => {
|
||||
const video = useVideo();
|
||||
|
||||
const icon = createMemo(() => {
|
||||
return {
|
||||
playing: "⏵",
|
||||
paused: "⏸",
|
||||
}[video.state()];
|
||||
});
|
||||
|
||||
return <button onclick={(e) => video.togglePlayState()}>{icon()}</button>;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue