Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ const config: PlaywrightTestConfig = {
actionTimeout: 0,
baseURL,
trace: 'on-first-retry',
headless: false,
video: 'on',
launchOptions: {
ignoreDefaultArgs: ['--mute-audio', '--disable-audio-output'],
slowMo: 3000,
},
},
projects: [
{
Expand Down
Binary file added public/audio.mp3
Binary file not shown.
16 changes: 15 additions & 1 deletion src/app/views/demo/Demo.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const DemoView: Component = () => {
const [muted, setMuted] = createSignal(false);
const [profile, setProfile] = createSignal<Profile>('personal');
const [searchParams] = useSearchParams();
let audioElem;

const increment = () => {
setCount((prev) => (prev += 1));
Expand All @@ -25,7 +26,14 @@ const DemoView: Component = () => {
};

const handleMuteInput = () => {
setMuted((old) => !old);
const existingState = muted();
const newState = !existingState;
if (newState) {
audioElem.play();
} else {
audioElem.pause();
}
setMuted(newState);
};

const handleProfileChange = (event: Event) => {
Expand Down Expand Up @@ -145,6 +153,12 @@ const DemoView: Component = () => {
</strong>
<span>(click to toggle)</span>
</label>
<audio
src="/audio.mp3"
ref={audioElem}
controls
loop
/>
</div>
<Show when={muted()}>
<p class={demoStyles.demoInteractionDesc}>
Expand Down