mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
got it working, but may revert to use on repo
This commit is contained in:
@@ -28,3 +28,4 @@ export type { WaSlideChangeEvent } from './slide-change.js';
|
|||||||
export type { WaStartEvent } from './start.js';
|
export type { WaStartEvent } from './start.js';
|
||||||
export type { WaTabHideEvent } from './tab-hide.js';
|
export type { WaTabHideEvent } from './tab-hide.js';
|
||||||
export type { WaTabShowEvent } from './tab-show.js';
|
export type { WaTabShowEvent } from './tab-show.js';
|
||||||
|
export type { WaVideoChangeEvent } from './video-change.js';
|
||||||
|
|||||||
26
packages/webawesome/src/events/video-change.ts
Normal file
26
packages/webawesome/src/events/video-change.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
export class WaVideoChangeEvent extends Event {
|
||||||
|
readonly detail: WaVideoChangeEventDetail;
|
||||||
|
|
||||||
|
constructor(detail: WaVideoChangeEventDetail) {
|
||||||
|
super('wa-video-change', { bubbles: true, cancelable: false, composed: true });
|
||||||
|
this.detail = detail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WaVideoChangeEventDetail {
|
||||||
|
previousIndex: number;
|
||||||
|
currentIndex: number;
|
||||||
|
video: {
|
||||||
|
title?: string;
|
||||||
|
poster?: string;
|
||||||
|
duration?: string;
|
||||||
|
sources: { src: string; type: string }[];
|
||||||
|
tracks: { src: string; kind: string; srclang: string; label: string }[];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface GlobalEventHandlersEventMap {
|
||||||
|
'wa-video-change': WaVideoChangeEvent;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user