Issue #991✓ SolvedOpened Apr 1, 2018by belal-azzam4 reactions

Uploading video in the image element

Quick answerby usman-vqode4

You can just add it to the video by using the asset manager... this.editor.on('component:create', model => { if (model.get('type') === 'video') { this.editor.runCommand('open-assets', { target: model }); } });

Read full answer below ↓

Question

hi. i was trying to implement uploading videos using the image element with the asset manager i stopped at the step where i wanted to replace the img tag with a video tag in the updateTarget call back, i am asking if there is an easy way for implementing that? thanks in advance. here is a snippet from my code

Answers (3)

👍 Most helpfulusman-vqodeAug 8, 2019

You can just add it to the video by using the asset manager...

this.editor.on('component:create', model => { if (model.get('type') === 'video') { this.editor.runCommand('open-assets', { target: model }); } });

artfApr 4, 2018

You can update the tag name of the component in this way model.set('tagName', 'new-tag')

artfApr 25, 2018

@ecmascriptguru I would rather suggest to extend the video component and implement the modal (like in ComponentImageView)

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.