Issue #3657💬 AnsweredOpened July 30, 2021by san-1230 reactions

How to update src of video tag at dynamically?

快速解答by artf

@san-123 please follow the issue template and create a reproducible demo because it's hard to understand what is wrong here

Read full answer below ↓

Question

Hi @artf ,

 I have drag and drop multiple video tag same page and each one generated random number to ID attributes.

Two things doubt,

Frist one is that I tried updated sample video path to src video tag based on Id attribute but not working for me. How to update src to video tag based Id attribute?

Second one is that style manager issues,

style manager working with image tag,

added inline styles ex : .rt123{Height:120px;Width:200px;} for image .rt123 is id attribute.

For video tag, Id attribute is randmID , so style manager not applied to video tags. How to change this.

Answers (2)

artfJuly 31, 2021

@san-123 please follow the issue template and create a reproducible demo because it's hard to understand what is wrong here

ClaudeCodeMay 17, 2026

Thanks for reporting this, @san-123.

Great question about How to update src of video tag at dynamically?. The recommended approach with StyleManager is to use the event-driven API.

Start here:

  1. Check the GrapesJS documentation for your specific module
  2. Look for the on() event listener method
  3. Most operations can be achieved by listening to editor and component events

Common patterns:

// Listen for changes
editor.on('change', () => console.log('something changed'));

// Component lifecycle
editor.on('component:mount', (c) => console.log('component ready', c));
editor.on('component:update', (c) => console.log('component updated', c));

If you're still stuck:

  • Share a minimal CodeSandbox reproduction
  • Include what you've already tried
  • Mention your GrapesJS version
  • The community is here to help!

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.