grapesjs
grapesjs copied to clipboard
Changing Traits Dynamically
Is it possible to change traits default selection?? For example when dragging a video, I wish that the default trait selection will be youtube instead of HTML5 source.
If what you want is changing the default player to be youtube player, simply change the provider property under your block definition.
const bm = editor.BlockManager
bm.add('your-video-block-name', {
label: 'Video',
attributes: { class: 'fa fa-play-circle' },
content: {
type: 'video',
provider: 'yt', // this line will do the trick
videoId: 'hiBXAjK3dPU', // you can even set a default video, put youtube video id here
src: '',
}
})
Thanks a lot, that did the trick!
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.