WordPress.org

Forums

MaxGalleria: WordPress Gallery Platform
[resolved] blocked youtube (4 posts)

  1. ab22375
    Member
    Posted 1 year ago #

    Hello,

    My website is on ssl. i have created a gallery of youtube videos using the protocol https://www.youtube.com ...
    but when they are imported, the links to youtube videos are recorded with http instead of https.

    The result is that no videos can be viewed in the popup, (in chrome, safari, firefox), while with opera they can be viewed.

    The error reported (firefox firebug):

    Blocked loading mixed active content "http://www.youtube.com/embed/.....?feature=oembed&fs=1&enablejsapi=1&wmode=transparent"

    If with firebug i change the link from http://www.youtube.com/embed/.... to https://www.youtube.com/embed/..... then everything works fine.

    How can I make maxgalleria register https instead of http?

    https://wordpress.org/plugins/maxgalleria/

  2. ab22375
    Member
    Posted 1 year ago #

    I have been working a little further on it.
    I have solved in this way:

    Replaced http with https in this line :

    $embed_code = '<iframe src="http://www.youtube.com/embed/' . $video_id . '?feature=oembed" width="' . $width . '" height="' . $height . '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';

    of file
    [wordpress]/wp-content/plugins/maxgalleria/addons/media-sources/youtube/youtube.php

    it becomes therefore

    $embed_code = '<iframe src="https://www.youtube.com/embed/' . $video_id . '?feature=oembed" width="' . $width . '" height="' . $height . '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';

    Then when I add links to youtube videos from maxgalleria I choose this format:

    https://www.youtube.com/v/video_id

    where video_id is the id of my video in youtube.

    In this way, maxgalleria saves the links correctly with https.

  3. arcware
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the info, we'll look to see if we can make this more seamless so that you don't have to edit one of the plugin files.

  4. Bladrak
    Member
    Posted 10 months ago #

    I did had the issue as well, in the exception that in order to fix it I had to edit the addons/templates/video-tiles/video-tiles.php file at line 148 to replace:

    $video_url = str_replace('https://', 'http://', get_post_meta($attachment->ID, 'maxgallery_attachment_video_url', true));

    with

    $video_url = get_post_meta($attachment->ID, 'maxgallery_attachment_video_url', true);

    May I ask why you replaced https with http?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • MaxGalleria: WordPress Gallery Platform
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic