ckeditor-html5-video icon indicating copy to clipboard operation
ckeditor-html5-video copied to clipboard

Support for toolbar items

Open atlguy opened this issue 8 years ago • 10 comments

It appears that this plug-in can only be used if using a toolbar group. Can you please add support for toolbar items so I can load and position this in a toolbar instead of using the group feature?

atlguy avatar Mar 16 '17 12:03 atlguy

editor.addCommand( 'html5video', new CKEDITOR.dialogCommand( 'html5video' ) );
editor.ui.addButton && editor.ui.addButton( 'html5video', {
				label: editor.lang.html5video.button,
				command: 'html5video',
				toolbar: 'insert,20'
			});

In plugin.js, add this code just before CKEDITOR.dialog.add( 'html5video', this.path + 'dialogs/html5video.js' );

and in your toolbar use name html5video

doghap avatar Mar 24 '17 09:03 doghap

Thank you. I tried that the button is not appearing.

atlguy avatar Mar 24 '17 14:03 atlguy

I managed to make it work:

var editor = CKEDITOR.replace( 'editor_text', {

	extraPlugins : 'html5video,lineutils,clipboard,widget,widgetselection,widgetcommon',
	toolbar      : [
		[ 'Image', 'html5video'],	
	];,
	
});

editor.addCommand( 'html5video', new CKEDITOR.dialogCommand( 'html5video' ) );
editor.ui.addButton && editor.ui.addButton( 'html5video', {
	label   : 'Video',
	command : 'html5video'
});

Ignore this one: CKEDITOR.dialog.add( 'html5video', this.path + 'dialogs/html5video.js' );

tetrahydra avatar May 03 '17 15:05 tetrahydra

Hi, guys. Due to my very busy student life, I am currently unable to help you. I hope after 2 weeks when the semester ends, I can help you actively. Cheers!

bahriddin avatar May 17 '17 01:05 bahriddin

I've found that you don't need to add: editor.addCommand( 'html5video', new CKEDITOR.dialogCommand( 'html5video' ) );

This just breaks the video insertion. Just this should work:

editor.ui.addButton && editor.ui.addButton( 'html5video', {
	label   : 'Video',
	command : 'html5video'
});

sg2002 avatar Mar 23 '18 11:03 sg2002

Hi, mates. Can I close this issue?

bahriddin avatar May 13 '18 05:05 bahriddin

tried all of above solution, nothing is working for me :(

sumitsk20 avatar May 28 '18 09:05 sumitsk20

it's still nothing :(

nquang2448 avatar Oct 24 '19 13:10 nquang2448

I use it with CKEditor 4.14 and django-ckeditor. I don't know why it works, but we have to define a button name with the First Capital letter, like this: 'Html5video' Example of my toolbar config:

{
'name': 'insert',
'items': ['Image', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe', 'Html5video']
},

SerhiyRomanov avatar Feb 25 '21 11:02 SerhiyRomanov

Sorry guys. I am not using CKEditor for several years and not quite sure what is happening here. PRs are welcome if you know the solution.

bahriddin avatar Feb 25 '21 12:02 bahriddin