Merge pull request #1292 from omarkhatibco/master
Support Youtube NoCookie mode
This commit is contained in:
commit
6be125db87
@ -400,11 +400,14 @@ const defaults = {
|
||||
enabled: false,
|
||||
publisherId: '',
|
||||
},
|
||||
|
||||
// YouTube nocookies mode
|
||||
noCookie: false,
|
||||
|
||||
// Preview Thumbnails plugin
|
||||
previewThumbnails: {
|
||||
enabled: false,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default defaults;
|
||||
|
@ -19,7 +19,7 @@ export const types = {
|
||||
*/
|
||||
export function getProviderByUrl(url) {
|
||||
// YouTube
|
||||
if (/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$/.test(url)) {
|
||||
if (/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(url)) {
|
||||
return providers.youtube;
|
||||
}
|
||||
|
||||
|
@ -153,6 +153,7 @@ const youtube = {
|
||||
// https://developers.google.com/youtube/iframe_api_reference
|
||||
player.embed = new window.YT.Player(id, {
|
||||
videoId,
|
||||
host: player.config.noCookie ? 'https://www.youtube-nocookie.com' : undefined,
|
||||
playerVars: {
|
||||
autoplay: player.config.autoplay ? 1 : 0, // Autoplay
|
||||
hl: player.config.hl, // iframe interface language
|
||||
|
Loading…
x
Reference in New Issue
Block a user