started a more proper implementation of the player

This commit is contained in:
Chris Kruining 2025-05-26 16:25:39 +02:00
parent d902f19d35
commit fbc040c317
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
6 changed files with 231 additions and 50 deletions

View 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>;
};