Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When trying to view a video on an HTTPS page in Firefox, the following error is thrown:
Blocked loading mixed active content "http://www.youtube.com/embed/pedWSC9WXaA?rel=1&autoplay=0&wmode=opaque"
The problem here is that the video filter hardcodes the HTTP protocol into the iframe URL, and firefox rejects HTTP iframes from HTTPS pages. As such, this line of code:
$video['source'] = 'http://www.youtube.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
Needs to be changed to this:
$video['source'] = '//www.youtube.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
I will attach a patch for this to the next comment (I need an issue number).
Comment | File | Size | Author |
---|---|---|---|
#1 | video_filter-remove_protocol_from_youtube_embed-2240181-1.patch | 615 bytes | Jaypan |
Comments
Comment #1
Jaypan CreditAttribution: Jaypan commentedAttaching a patch to fix this bug. Please note that by removing the protocol, the video works for both http and https.
Comment #2
ultimateboy CreditAttribution: ultimateboy commentedClosing as a duplicate of #786774 which has a patch which fixes this for every provider and not just youtube.