Skip to content

Feature: Add GIF Support to MediaBlock and ShowBlock #4656

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rashap224
Copy link

Issue Reference: Fixes #4560

Description
This pull request introduces GIF support to the MediaBlock and ShowBlock classes, allowing users to import and display GIFs within the application. The feature enhances the media capabilities of Music Blocks by enabling dynamic and animated content.

Changes Made

1. MediaBlock Enhancements:

  • Updated the MediaBlock class to handle GIF files.
  • Integrated a GIF playback library (e.g., gif.js) to process and display GIFs.
  • Modified the loadThumbnail method to detect and handle GIF files appropriately.

2. ShowBlock Enhancements:

  • Ensured the ShowBlock class can render GIFs on the canvas.
  • Adjusted the flow logic to support animated media.

3. Documentation:

  • Updated the help strings for the MediaBlock to reflect GIF support.

Testing

  • Verified that GIFs can be imported and displayed correctly using the MediaBlock.
  • Confirmed that the ShowBlock renders GIFs as expected on the canvas.
  • Ran the full test suite to ensure no regressions were introduced.

Impact

  • Adds support for animated media (GIFs) to the application.
  • Enhances the user experience by enabling dynamic visual content.

Copy link

✅ All Jest tests passed! This PR is ready to merge.

@rashap224
Copy link
Author

@pikurasa Can u review the PR for this issue and provide feedback.

@FirePheonix
Copy link
Contributor

@rashap224 can you please provide a video recording of this fix?

@pikurasa
Copy link
Collaborator

@rashap224

I tested it, but it doesn't seem to work.

Log:

Uncaught TypeError: Cannot set properties of undefined (setting 'connections')
    at Blocks.makeBlock (blocks.js:3597:47)
    at paletteBlockButtonPush (palette.js:32:24)
    at Palette._makeBlockFromPalette (palette.js:1296:30)
    at Palette._makeBlockFromProtoblock (palette.js:1424:33)
    at Image.up (palette.js:1047:26)

Screenshot from 2025-04-27 20-30-29

@Rishikesh63
Copy link

@pikurasa i think @rashap224 removed prototype for text ,error is due to that

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.

GIF support for media block
4 participants