@vime/core
Version:
Customizable, extensible, accessible and framework agnostic media player.
28 lines (24 loc) • 945 B
JavaScript
import { r as registerInstance, h } from './index-f5fd0f81.js';
import { f as formatTime } from './formatters-1343ea73.js';
import { c as withComponentRegistry } from './withComponentRegistry-28311671.js';
const timeCss = ".time{display:flex;align-items:center;color:var(--vm-time-color);font-size:var(--vm-time-font-size);font-weight:var(--vm-time-font-weight)}";
const Time = class {
constructor(hostRef) {
registerInstance(this, hostRef);
/**
* The length of time in seconds.
*/
this.seconds = 0;
/**
* Whether the time should always show the hours unit, even if the time is less than
* 1 hour (eg: `20:35` -> `00:20:35`).
*/
this.alwaysShowHours = false;
withComponentRegistry(this);
}
render() {
return (h("div", { class: "time", "aria-label": this.label }, formatTime(Math.max(0, this.seconds), this.alwaysShowHours)));
}
};
Time.style = timeCss;
export { Time as vm_time };