Set video component to have only youtube as the provider. #5620
-
Hi, at the moment this component have youtube as the default provider, but the user can still change it to vimeo or a html5 source, i want youtube to be the only possible option, also if possible i want to set it to use the entire youtube link instead of the id, i did not find anything at all looking at the GrapesJS doc's.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I managed to limit it using getProviderTrait
|
Beta Was this translation helpful? Give feedback.
I managed to limit it using getProviderTrait
editor.Blocks.add('video', { label: 'Vídeo', media:
, content: '<div data-gjs-type="video" style="width: 50%; margin: 10px"></div>' })
editor.DomComponents.addType('video', { model: { defaults: { provider: 'yt' }, getProviderTrait() { return { type: 'select', label: 'Provider', name: 'provider', changeProp: true, options: [{ value: 'yt', name: 'Youtube' }] } } } })