@solid-mediakit/media
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

@solid-mediakit/media

A video utility library for Solid.

Installation

pnpm install @solid-mediakit/media

Usage

import { createVideo } from '@solid-mediakit/media'
import { type VoidComponent } from 'solid-js'

const { Video, play, pause, paused } = createVideo({
  source: 'https://www.w3schools.com/html/mov_bbb.mp4',
  type: 'video/mp4',
})

const Home: VoidComponent = () => {
  return (
    <div class='flex flex-col gap-2 items-center justify-center py-12'>
      <h1 class='text-3xl font-bold'>Home</h1>
      <h3 class='text-xl font-bold text-gray-400'>
        Status: {paused() ? 'Paused' : 'Playing'}
      </h3>
      <Video autoplay />
      <div class='flex gap-2 items-center'>
        <button
          onClick={play}
          class='rounded-lg bg-purple-400 text-white flex items-center justify-center p-3'
        >
          Play
        </button>
        <button
          onClick={pause}
          class='rounded-lg bg-purple-400 text-white flex items-center justify-center p-3'
        >
          Pause
        </button>
      </div>
    </div>
  )
}

export default Home

Read More Here

Readme

Keywords

none

Package Sidebar

Install

npm i @solid-mediakit/media

Weekly Downloads

1

Version

0.0.7

License

ISC

Unpacked Size

29.2 kB

Total Files

20

Last publish

Collaborators

  • orjdev
  • thomas_beer
  • davedbase