Lily/Video: Update volume functions to interact with the project volume
Resolves https://github.com/TurboWarp/extensions/issues/2033
Let the video's volume be affected by the project's volume (which can be manipulated through Scratch Addons and Sound Expanded).
The "volume of video" reporter has been updated to only return the video's personal volume, and does not take into account the project's volume.
https://github.com/user-attachments/assets/31dc0dca-23c2-488e-8ca0-a4725315e845
I feel like it would be more efficient to iterate through all created videos rather than all skins
I feel like it would be more efficient to iterate through all created videos rather than all skins
I wrote it the way I did because I was copying the above and below events-- I'm not really familiar with this extension, and so I don't want to mess around with it too much. I know you've worked on this one in the past, though, so if you know how to do what you're suggesting, help would be appreciated.
It looks like in this pull request the video element's volume doesn't actually change until end of frame. If the project's scripts get stuck for a while that might mean the volume blocks are now noticeably delayed, until the scripts are unstuck
It looks like in this pull request the video element's volume doesn't actually change until end of frame. If the project's scripts get stuck for a while that might mean the volume blocks are now noticeably delayed, until the scripts are unstuck
wouldnt before execute work
No that would another frame of delay
Old version would update element volume in middle of frame, not on either end. Not sure if browsers actually process those changes mid frame or if they end up waiting until the end anyways
It looks like in this pull request the video element's volume doesn't actually change until end of frame. If the project's scripts get stuck for a while that might mean the volume blocks are now noticeably delayed, until the scripts are unstuck
You could emit an event from the addon similar to the pause addon, that can be listened to instead, this is how Unsandboxed (the mod) does it and it works perfectly fine
The situation I described does not involve the addon at all
Although yes without an event the slider will always be a tiny bit delayed
Another option is a making media source node and connecting it to the audio engine. That could help make autoplay more reliable
The situation I described does not involve the addon at all
I know. The point of using a event would mean you are not waiting for a frame to finish or start, and only when the volume actually updates.
!format
yes that solves the project i was talking about once you remove the leftover console.log
!format
!format
this is insanely resource in-effecient but since the idea for volume changes to become an event is not happening we may aswell merge this in its current state.
yes its not ideal but we already have this O(n) loop so its not regressing much