Hi,

I'm trying to embed a video from YouTube.
I don't want it to autoplay but it does even when Autoplay is set to zero.

Any thoughts?

Comments

saurabh.dhariwal’s picture

I checked same stuff at my local and this is done after making some change for autoplay functionality.

Code requires change at line 34 :

Find below three liner code into "video_filter/editors/tinymce/video_filter.js" line number around 34.

if ($('#edit-autoplay').is(':checked')) {
   str += ' autoplay:' + $('#edit-autoplay').val();   
}

And replace above three lines with below code:

//Check for autoplay default setting.
if ($('#edit-autoplay').is(':checked')) {
   str += ' autoplay:' + $('#edit-autoplay').val();   
}
else {
   str += ' autoplay:0';
}

Now after this change, the video could not auto play until you set "Default autoplay setting" as "Yes".

Let me know if you face any query regarding this.

Thanks!

sheldonkreger’s picture

That solution may work for TinyMCE but will not work for CKEditor. The good news is that the autoplay:0 config works in CKEditor. Anything we can do on the Drupal level rather than in the JS libraries to make this work for everybody?

blackdog’s picture

Status: Active » Closed (duplicate)

This is fixed in #2187589.