fonini / ckeditor-youtube-plugin

CKEditor Plugin to embed Youtube videos.
https://fonini.github.io/youtube-plugin-for-ckeditor-4.html
Do What The F*ck You Want To Public License
51 stars 61 forks source link

Add an option to create anchor tag instead of embedded iframe #41

Closed ron0 closed 8 years ago

ron0 commented 8 years ago

We use CKEDITOR as an editor for email. Most email services and clients will block an iframe, so proper embedding of video would be via an anchor tag and image. We request an additional option n the dialog, either a new checkbox, or perhaps in a dropdown list with the current embed iframe and old embed code as alternate options, where the content is defined like:

    else if (this.getContentElement( 'youtubePlugin', 'chkNoEmbed' ).getValue() === true)
    {
        var imgsrc = '//img.youtube.com/vi/' + video + '/sddefault.jpg';
        content += '<a href="' + url + '" ><img width="' + width + '" height="' + height + '" src="' + imgsrc + '" '  + responsiveStyle + '/></a>';
    }

Note this stackexchange thread on the source of the thumbnail image: http://stackoverflow.com/questions/2068344/how-do-i-get-a-youtube-video-thumbnail-from-the-youtube-api

fonini commented 8 years ago

Added in de58f0f245afe90d53eed6f7a9c8fb91e29568dc