Issue #1572💬 AnsweredOpened November 10, 2018by crypto-dump0 reactions

Issue when adding video block manually

快速解答by artf

The style you see on <video> is only applied in canvas, your styles are applied to the wrapper and you should see them correctly applied in the export code

Read full answer below ↓

Question

I added Video Block manually like this.

代码片段TEXT
<pre>
blockManager.add('video', {
	label: 'Video',
	category: 'Media',
	attributes: {class: 'fa fa-youtube-play'},
	content: {
		type: 'video',
		classes: ['website-media', 'website-video'],
		//traits: ['data-panoramic'],
		resizable: 0,
		draggable: '.website-cell, .website-block, .video-container, .media-container',
		style: {
			width: '100%',
			height: 'auto'
		}
	},
});
</pre>

It seems this produce this element when I drop the video block to editor.
`<div class="website-media website-video" data-gjs-type="video" onmousedown="return false">`
`          <video src="" class="gjs-no-pointer" style="height: 100%; width: 100%;"></video>`
`</div>`
**But the height of video element is different every time when I add several video blocks,**

Answers (2)

artfNovember 16, 2018

The style you see on <video> is only applied in canvas, your styles are applied to the wrapper and you should see them correctly applied in the export code

lock[bot]November 16, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.