Add support for muted property in Video Block for improved video sound control#6512
Merged
artf merged 2 commits intoGrapesJS:devfrom Jun 10, 2025
Merged
Add support for muted property in Video Block for improved video sound control#6512artf merged 2 commits intoGrapesJS:devfrom
artf merged 2 commits intoGrapesJS:devfrom
Conversation
artf
approved these changes
Jun 10, 2025
Member
|
Thanks for the PR @ankitkoo7 great addition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request introduces support for the
mutedproperty in the Video Block component within GrapesJS. This addition enables more precise control over video sound behavior, improving compatibility with autoplay requirements and overall user experience.Changes Introduced
Video Block Model Enhancements:
mutedattribute has been added as a boolean trait, allowing it to be set via the component interface.Video Block View Adjustments:
mutedstate is now applied to both native<video>elements and embedded<iframe>videos, ensuring consistent behavior regardless of the video source.Trait and Event Integration:
mutedproperty is exposed in the editor through the trait manager.Motivation
Due to modern browser restrictions, autoplaying videos must be muted by default. This update ensures that videos embedded using the Video Block component comply with these requirements, thereby avoiding unexpected playback issues. It also provides developers with greater control over media presentation within the GrapesJS environment.
Additional Notes
This enhancement improves both compliance and usability, offering a more complete and configurable video embedding experience across all supported platforms.