fix(embeddings): YouTube embedding requires referrer
The embedded YouTube player seemed not to work anymore and showed a warning "invalid player configuration". This seems to be related to the iframe being loaded without a referrer to the origin domain. YouTube nowadays requires this (probably to track from which domains a YouTube player is embedded). See also: https://developers.google.com/youtube/terms/required-minimum-functionality#embedded-player-api-client-identity Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
### Bugfixes
|
||||
- Ignore the healthcheck endpoint in the "too busy" limiter
|
||||
- Send the referrer origin for YouTube embeddings due to their requirement
|
||||
|
||||
## <i class="fa fa-tag"></i> 1.10.3 <i class="fa fa-calendar-o"></i> 2025-04-09
|
||||
|
||||
|
||||
@@ -816,7 +816,7 @@ export function smoothHashScroll () {
|
||||
|
||||
function imgPlayiframe (element, src) {
|
||||
if (!$(element).attr('data-videoid')) return
|
||||
const iframe = $("<iframe style='border: none' allowfullscreen></iframe>")
|
||||
const iframe = $('<iframe style="border: none" allowfullscreen referrerpolicy="strict-origin-when-cross-origin"></iframe>')
|
||||
$(iframe).attr('src', `${src + $(element).attr('data-videoid')}?autoplay=1`)
|
||||
$(element).find('img').css('visibility', 'hidden')
|
||||
$(element).append(iframe)
|
||||
|
||||
Reference in New Issue
Block a user