Embed Youtube

Hi! Sorry but i still keep having issues trying to get an embed youtube video on my websites. Once the page is loaded, the iframe tag is printed as text. Lots of things i did in order to solve this, but none of these works well. Could you give me some variants to debug it ? Thank you!

Comments

  • Which Rich Text Editor are you using for the field? Either way, you need to switch to "plain test" mode before pasting raw HTML tags.

    If you're using CKEditor, it may be worth looking at what plugins are available for it. There's bound to be YouTube video support...
  • edited 6:33PM
    I´am using CKEditor with several configurations to accept the iframe tag:

    $config['ckeditor']['default'] = array(
    'toolbar' => array(
    array('Bold', 'Italic', 'Strike'),
    array('Format'),
    array('FUELImage', 'HorizontalRule',"Embed"),
    array('NumberedList', 'BulletedList'),
    array('FUELLink', 'FUELUnlink',"Source"),
    array('Undo', 'Redo', 'RemoveFormat'),
    array('PasteFromWord', 'PasteText'),
    array("btgrid",'Maximize'),
    ),
    'htmlEncodeOutput' => FALSE,
    'entities' => FALSE,
    'bodyClass' => 'ckeditor',
    'protectedSource' => array('/g','/<\/i>/g'),
    'toolbarCanCollapse' => TRUE,
    'extraPlugins' => 'fuellink,fuelimage,btgrid,widget,dialog,embedbase,notificationaggregator,embed,notification',
    'removePlugins' => 'link,image',
    'allowedContent' => 'iframe[*]',
    'extraAllowedContent'=>'iframe[*]',
    'contentsCss' => WEB_PATH.'assets/css/ckeditor.css'
    // 'previewParserPath' => fuel_url('preview'),
    );

    Just pasting the "share" code provided by youtube.

    Thanks!
  • edited 6:33PM
    Also, if it is your own module, you may want to set the following module parameter for your module in the fuel/application/config/MY_fuel_modules.php to prevent the CI xss_clean function from running:
    'sanitize_input' => array('template','php'),
  • edited 6:33PM
    Done, but no successful results:
    $config['modules']['articles'] = array(
    'preview_path' => 'articulos/{slug}',
    'display_field' => 'title',
    'sanitize_input' => array('template','php')
    );
  • edited 6:33PM
    Does it work if you paste it in using the default editor instead of CKEditor?
  • Come back again with this issue.
    Yes, this works fine using markitup.
  • Hi! I`ve solved this long issue using the ** youtube ** plugin:

    $config['ckeditor']['default'] = array(
    'toolbar' => array(
    array('Bold', 'Italic', 'Strike'),
    array('Format'),
    array('FUELImage', 'HorizontalRule',"Youtube"),
    array('NumberedList', 'BulletedList'),
    array('FUELLink', 'FUELUnlink'),
    array('Undo', 'Redo', 'RemoveFormat'),
    array('PasteFromWord', 'PasteText'),
    array('Maximize'),
    ),
    'contentsCss' => WEB_PATH.'assets/css/main.css',
    'htmlEncodeOutput' => FALSE,
    'entities' => FALSE,
    'bodyClass' => 'ckeditor',
    /*'protectedSource' => array('/\{fuel_\w+\(.+\)\}/g', '/<\?[\s\S]*?\?>/g'), */
    'toolbarCanCollapse' => FALSE,
    'extraPlugins' => 'fuellink,fuelimage,youtube',
    'removePlugins' => 'link,image',
    'allowedContent' => TRUE,
    "youtube_responsive" => true,
    "youtube_related" => false,
    "youtube_controls" => true,
    "youtube_autoplay" => false
    // 'previewParserPath' => fuel_url('preview'),
    );
  • Hi!

    I was thinking if you want i could do a PR to develop branch with this improvement. Let me know what do you think.
  • edited 6:33PM
    Did you create the Youtube plugin or is that something you found elsewhere? If elsewhere, would you mind sending a link to it?
Sign In or Register to comment.