diff --git a/config.local.js.SAMPLE b/config.local.js.SAMPLE index 4d2d7761f..72bb99a27 100644 --- a/config.local.js.SAMPLE +++ b/config.local.js.SAMPLE @@ -256,7 +256,7 @@ export default { youtube: { // api_key: "INSERT YOUR VALUE", // parts: [ "snippet", "player" ], // list of fields you want to use in the request, in most cases you only need those two - get_params: "?rel=0&showinfo=1" // https://developers.google.com/youtube/player_parameters, + get_params: "?rel=0&showinfo=1", // https://developers.google.com/youtube/player_parameters, fix_shorts_in_eu: true // Avoid consent redirect for EU servers }, vimeo: { diff --git a/lib/plugins/system/oembed/oembed.js b/lib/plugins/system/oembed/oembed.js index d33470d9c..94f1dcb36 100644 --- a/lib/plugins/system/oembed/oembed.js +++ b/lib/plugins/system/oembed/oembed.js @@ -31,51 +31,60 @@ function fixOembedIframeAttributes(obj) { } function _getOembedIframe(oembed) { - if (!oembed.html) { - return null; - } + if (typeof oembed._iframe === 'undefined') { - // Allow encoded entities if they start from $lt; - var html = oembed.html5 || oembed.html; - if (/^<$/i.test(html)) { - html = entities.decodeHTML(html); - } + var _iframe = null; + + if (oembed.html5 || oembed.html) { + + // Allow encoded entities if they start from $lt; + var html = oembed.html5 || oembed.html; + if (/^<$/i.test(html)) { + html = entities.decodeHTML(html); + } + + var $container = cheerio('