-
Notifications
You must be signed in to change notification settings - Fork 238
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
Video: Add Video extension #840
Conversation
This is the only extension I've worked on recently where I've had no idea what the palette was going to look like, so feedback/suggestions from anyone would be greatly appreciated! |
Can you explain how this works? |
it is extremely impressive. |
From reading the code, it just seems to put a HTML |
Your extension is awesome. |
But it only works on TurboWarp. |
Damn this is insane, I completely forgot the video html tag exists. I thought it wouldn't be possible without an iframe or something. |
If anyone has any idea why this doesn't work packaged, let me know |
you are a hero |
I have a theory, A TURBOWARP THEORY. I think the packager only packages the project part of the html only. It omits any other part of the html code when packaging, because all you're doing is making the video element sit on top of the project itself, if the video is going to be packaged, then it needs to be a part of the stage. |
I do know that the packager's project player works somewhat differently from vanilla Scratch, so that might be why. |
Something to consider is that you should be able to use a video element in renderer.updateBitmap to upload the current frame (which you could then repeat each frame). It'll be less efficient but you would be able to integrate with the rest of Scratch, same as Skins |
I did try this, but I couldn't quite figure it out. And in this case, how would the block palette even look? |
Some suggestions, rename "resume video" to "play video", it makes more sense in terms of its functionality. And in terms of new blocks, it would be great if there are blocks that allow you to set a size to the video player and a location to the video player, like "resize video to width height" and "change video x y" something like that. |
I know a way to make your extension work on single html files, .exe files, .app files ... I reality, the video is loaded on the page but it's 𝑥 layers behind the canvas. So you can resolve the problem by adding: So, I think it should do the trick. |
I've opted to just rendering it onto sprites now |
Changes:
To do:
As much as it is easier to load 1 video at a time, it would be really nice to support multiple videos as if they are skins (also beneficial for the user). My only problem with this is I want the extension to be easily understood, and any layer of complexity will ruin that. Something to think about. I'll see what works. |
Changes:
To do:
Known issues:
|
- Fixed bug with targets not getting reset
Adds a check for if the video is paused before updating the bitmap skin of various targets.
Should I go the extra mile and check if any drawables are visible (ie, shown/hidden) before updating the bitmap? Or is it fine as-is |
Closes #431 |
The only strictly backwards-incompatible change I hope I made was merging "get volume of [ ]" into the "get [ ] of [ ]" block that already existed for other things. Otherwise I made it work more in-line with how Animated Text does - update the skin immediately, delay all texture update as long as possible (getTexture()), mark as dirty only when needed. I'll do some bigger tests tonight with more real videos, trying to get this merged for desktop 1.9.0 |
last thing here - does it make sense to wait for the video to load at least a tiny bit before "load video from URL" completes? |
I think so, yes. |
how do i add a youtube video? |
@daisytheumbreon-B3, use the iframe extension for YouTube videos. |
can this extension somehow access local videos? Or is there another extension out there for this? |
Thank you @CST1229 :D |
Video Extension
Simple extension to play video files from URLs. Wip.
Closes #431
Things I WILL NOT add: