Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Show controls' button should be ticked by default #38

Open
mvl22 opened this issue Oct 27, 2020 · 3 comments
Open

'Show controls' button should be ticked by default #38

mvl22 opened this issue Oct 27, 2020 · 3 comments

Comments

@mvl22
Copy link

mvl22 commented Oct 27, 2020

By default 'Show controls' seems to be off, which seems to be an unhelpful default.

Screenshot 2020-10-27 at 22 43 58

It does not seem to be possible to change this programmatically using the CKEditor JS API either :(

@bbailla2
Copy link

bbailla2 commented Nov 23, 2020

I haven't tested this, but I'm guessing plugin.js line 25 should grab a value from the CKEditor's configuration?

var controls = '';

@jonespm
Copy link

jonespm commented Mar 6, 2021

Yeah, the pattern used in a plugin like autosave would work well. Just have a new config like html5video that can can change the defaults here.

https://github.com/w8tcha/CKEditor-AutoSave-Plugin/blob/55029859eb3ddb2c5537f99304ba782dd30880ca/autosave/plugin.js#L38

jonespm added a commit to jonespm/ckeditor-html5-video that referenced this issue Mar 6, 2021
jonespm added a commit to jonespm/ckeditor-html5-video that referenced this issue Mar 6, 2021
@JerryTam
Copy link

JerryTam commented Dec 14, 2023

edit html5video/plugin.js
image

                   if (editor.config) {
                        var getConfig = function(key, defaultVal = false) {
                            if (editor.config[`html5video_${key}`] != undefined) {
                                return editor.config[`html5video_${key}`];
                            } else if (editor.config.html5video && editor.config.html5video[key] != undefined) {
                                return editor.config.html5video[key];
                            } else {
                                return defaultVal;
                            }
                        }
                        this.setData('controls', getConfig('controls'));
                        this.setData('autoplay', getConfig('autoplay', 'no'));
                        this.setData('responsive', getConfig('responsive'));
                    }

use example

global config

        config.extraPlugins = 'html5video';

	config.html5video = {
		// controls: true,
		// autoplay: 'yes', // [yes, no]
		// responsive: true,
	};

single config

            CKEDITOR.replace('dom id', {
                filebrowserImageUploadUrl: '/foo',
                filebrowserHtml5videoUploadUrl: '/bar',
                extraPlugins: 'html5video',
                html5video_controls: true,
                html5video_responsive: true,
                html5video_autoplay: 'yes',
            });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants