mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-17 07:34:21 +01:00
* aligning ui of dialog and media bar * refactored media progress logic to be reusable * updating track times to be consistent with music assistant * WIP aligning volume slider with music assistant * migrating to ha-dropdown * showing volume tooltip on touch devices * Fixed volume slider going to 100 randomly * Added scrolling support * Refactored volume control logic
20 lines
408 B
TypeScript
20 lines
408 B
TypeScript
export const startMediaProgressInterval = (
|
|
interval: number | undefined,
|
|
callback: () => void,
|
|
intervalMs = 1000
|
|
): number => {
|
|
if (interval) {
|
|
return interval;
|
|
}
|
|
return window.setInterval(callback, intervalMs);
|
|
};
|
|
|
|
export const stopMediaProgressInterval = (
|
|
interval: number | undefined
|
|
): number | undefined => {
|
|
if (interval) {
|
|
clearInterval(interval);
|
|
}
|
|
return undefined;
|
|
};
|