Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AudioPlayer.svelte: fix: begin playing sound again on ended #560

Closed
wants to merge 1 commit into from

Conversation

marfrede
Copy link

@marfrede marfrede commented Jan 9, 2024

Bug: on:ended the time was set to 0 but after the audio/video ends the audio/video is paused automatically.

Fix: on:ended the audio/video needs to be unpaused again.

Copy link

vercel bot commented Jan 9, 2024

@marfrede is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

Bug: on:ended the time was set to 0 but after the audio/video ends the audio/video is paused automatically.

Fix: on:ended the audio/video needs to be unpaused again.
@marfrede
Copy link
Author

marfrede commented Jan 9, 2024

// for showcase it could also be like below, but the time is set to beginning automatically when audio is unpaused after it ended 
time = 0;
paused = false;

@Rich-Harris
Copy link
Member

Thank you but this isn't desirable behaviour. If you want audio to loop, using the loop attribute, don't use JavaScript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants