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)
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.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #374
Is it possible that I change value in traits that will directly reflected in component?
Like If I created drop-down in traits and with a select value of dropdown I want to change the text that is present in that component witho...
Issue #1413
How To Change the styles of traits
Hi Artf, Thank you for your work, I would like to change the styles of the traits. And when user select video or input's make trait icon ac...
Issue #477
By default disable Traits, On previous change in traits Enable next traits.
Hello, So, I want to define Two traits in the component settings. First one is CheckBox and another one is TextBox(There can be multiple)....
Issue #873
[Need help]: After using urlLoad from storage manager impossible to change component with Traits
Hello, I am save template to db and after loading from db impossible to change component with Traits. Video example on countdown: https://y...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.