mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 23:00:03 +00:00
fix(studio): add preview audio mute controls (#853)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveSeekPercent } from "./PlayerControls";
|
||||
import { shouldMutePreviewAudio } from "../lib/timelineIframeHelpers";
|
||||
|
||||
describe("resolveSeekPercent", () => {
|
||||
it("returns 0 when the track width is invalid", () => {
|
||||
@@ -18,3 +19,19 @@ describe("resolveSeekPercent", () => {
|
||||
expect(resolveSeekPercent(150, 100, 200)).toBe(0.25);
|
||||
});
|
||||
});
|
||||
|
||||
describe("shouldMutePreviewAudio", () => {
|
||||
it("mutes when the user toggled audio off", () => {
|
||||
expect(shouldMutePreviewAudio(true, 1)).toBe(true);
|
||||
});
|
||||
|
||||
it("auto-mutes above 1x playback", () => {
|
||||
expect(shouldMutePreviewAudio(false, 1.5)).toBe(true);
|
||||
expect(shouldMutePreviewAudio(false, 2)).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps audio on at 1x or slower when the user has not muted it", () => {
|
||||
expect(shouldMutePreviewAudio(false, 1)).toBe(false);
|
||||
expect(shouldMutePreviewAudio(false, 0.5)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user