You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be fairly niche, but I've had to implement custom controls for audio and video elements a lot of times, and it's always a bit finicky. In particular, the timeupdate event fires surprisingly infrequently during playback, meaning your progress bar (or whatever else is synced to the currentTime) moves in a choppy fashion.
(The timeupdate listener is still necessary, since it's possible for currentTime to be affected externally, e.g. if it has built-in controls that the user drags.)
bind:duration would presumably look something like this...
...except in dev mode, where we can write code that reflects its read-only nature:
letduration_updating=false;audio.addEventListener('durationchange',function(){duration_updating=true;component.set({duration: this.duration});duration_updating=false;});component.observe('duration',function(){if(!duration_updating){thrownewError('<audio> duration is read-only');}});
Not a super high priority, just something that would add a touch of delight when developing these sorts of apps.
The text was updated successfully, but these errors were encountered:
This might be fairly niche, but I've had to implement custom controls for audio and video elements a lot of times, and it's always a bit finicky. In particular, the
timeupdate
event fires surprisingly infrequently during playback, meaning your progress bar (or whatever else is synced to thecurrentTime
) moves in a choppy fashion.I'd love to be able to just do this:
(The
refs.audio.play()
thing is made up, I couldn't be bothered to write the relevant<script>
. But maybe we should do that too...)Binding to
currentTime
would add something like this:(The
timeupdate
listener is still necessary, since it's possible forcurrentTime
to be affected externally, e.g. if it has built-in controls that the user drags.)bind:duration
would presumably look something like this......except in dev mode, where we can write code that reflects its read-only nature:
Not a super high priority, just something that would add a touch of delight when developing these sorts of apps.
The text was updated successfully, but these errors were encountered: