Merge branch 'master' into develop

# Conflicts:
#	readme.md
This commit is contained in:
Sam Potts
2019-04-12 12:40:12 +10:00
2 changed files with 16 additions and 4 deletions

View File

@ -34,6 +34,19 @@ function assurePlaybackState(play) {
}
}
function getHost(config) {
if (config.noCookie) {
return 'https://www.youtube-nocookie.com';
}
if (window.location.protocol === 'http:') {
return 'http://www.youtube.com';
}
// Use YouTube's default
return undefined;
}
const youtube = {
setup() {
// Add embed class for responsive
@ -151,7 +164,7 @@ const youtube = {
// https://developers.google.com/youtube/iframe_api_reference
player.embed = new window.YT.Player(id, {
videoId,
host: config.noCookie ? 'https://www.youtube-nocookie.com' : undefined,
host: getHost(config),
playerVars: extend(
{},
{