aboutsummaryrefslogtreecommitdiffstats
path: root/src/user/index.ts
blob: 2caf88c8a3ae2e62e4f7341422cc18935e7fdf07 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { Video as BaseVideo, type FrameTime } from '$/lib/Player/Video';
import SneakySnitchUrl from './Sneky Snitch.mp4?url'

export default class Video extends BaseVideo {
  public ctx!: CanvasRenderingContext2D
  public init(): void | Promise<void> {
    // this.resize(this.canvas.clientWidth,this.canvas.clientHeight)
    this.resize(1920, 1080)
    this.ctx = this.canvas.getContext('2d')!
  }
  public renderFrame(time: FrameTime): Promise<void> | void {
    this.ctx.fillStyle = '#000'
    this.ctx.fillRect(0, 0, this.w, this.h)
    this.ctx.font = "50px Nunito";
    this.ctx.fillStyle = '#fff'
    this.ctx.fillText(`${time.seconds.toFixed(3)}`, 0, 50)
  }
  public fps = 30;
  public length = 3 * this.fps;
  public audioUrl = ['sneakysnitch.mp4', SneakySnitchUrl] as const
}