import { BaseController } from "../../utilities/base_controller" ; export class MediaPlayerController extends BaseController { static targets = [ "media" ] ; declare readonly mediaTarget : HTMLMediaElement ; async play ( event ? ) { event ?. preventDefault ( ) ; await this . mediaTarget . play ( ) ; } pause ( event ? ) { event ?. preventDefault ( ) ; this . mediaTarget . pause ( ) ; } restart ( event ? ) { event ?. preventDefault ( ) ; this . mediaTarget . currentTime = 0 ; } seek ( event ? ) { event ?. preventDefault ( ) ; this . mediaTarget . currentTime += 5 ; } }