Issue #2081Opened June 17, 2019by Amir28280 reactions

Changing Traits Dynamically

Question

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.

Answers (3)

afdallahJune 19, 20190 reactions

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: '', 
  }
})
Amir2828June 25, 20190 reactions

Thanks a lot, that did the trick!

lock[bot]June 24, 20200 reactions

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.