• Resolved Vivian E

    (@vivibosslink)


    Tutor LMS appears to be conflicting with my site and removing the Youtube embed I have on my Articles! For example, please check the affected page I linked! There is a Youtube embed on the top of that page that is not showing anymore! When I deactivate Tutor LMA plugin, the embed comes back but when I activate TUtor LMS plugin, the embed stops showing! please help!!!

    The page I need help with: [log in to see the link]

Viewing 11 replies - 16 through 26 (of 26 total)
  • inspire1989

    (@inspire1989)

    @walldyney no it hasn’t really. We just have a workaround that requires you to change source code on your own.

    Plugin Support Md. Jobayer Al Mahmud

    (@jobayertuser)

    Hello @walldyney

    You can check it by yourself after the update.

    Mauricio

    (@mauriciogarofalo)

    YouTube embeds not working, TutorLMS update to 2.1.2

    Temporal fix:

    Please edit the following file:
    wp-content/plugins/tutor/classes/Course_Embed.php
    
    Comment line 28:
    
    add_filter( 'embed_oembed_html', __CLASS__ . '::oembed_iframe_overrides', 10, 3 );
    
    to
    
    //add_filter( 'embed_oembed_html', __CLASS__ . '::oembed_iframe_overrides', 10, 3 );
    • This reply was modified 2 years ago by Mauricio.
    • This reply was modified 2 years ago by Mauricio.
    walldyney

    (@walldyney)

    Thanks @mauriciogarofalo looks like they won’t fix this anytime soon, as since the other version this problem hasn’t been fixed, even with two updates. Your answer was pretty smooth @jobayertuser, wouldn’t it be easier to say they didn’t fix the problem?

    Plugin Support Md. Jobayer Al Mahmud

    (@jobayertuser)

    Hello @walldyney

    I reported the problem before the release but maybe in this release, our developer did not fix the problem. I will push them to fix this in our next update.

    metaphysician

    (@metaphysician)

    i just started looking at this for our course development and no iframe embed support is a total deal breaker for us. it’s too bad as i really do like the look of the layout and the course builder is pretty good as well. i guess the idea is to update the code and then not update the LMS until that feature is added for certain – otherwise you’d just get to edit the script again.

    Update – well the comment fix doesn’t help me at all. i did edit the script, and went back to creating the lesson, and when editing lesson content and placing the iframe content and then saving the lesson, when you go back to it, it’s completely blank. it doesn’t save the text at all.

    additionally the editor will claim at the bottom ‘No video source selected from settings!’ even after i chose to turn on the YouTube player under the settings.

    it’s really a shame as i did prefer the layout and look and feel, but it’s not ready for my purposes as yet it seems.

    Plugin Support Md. Jobayer Al Mahmud

    (@jobayertuser)

    Hello @metaphysician

    We are going to release our fixed version very shortly so till then you can wait or you can try this solution bellow.

    wp-content/plugins/tutor/classes/Course_Embed.php go here and replace the full function name oembed_iframe_overrides with this.

    public static function oembed_iframe_overrides( $html, $url, $attr ) {
    
            $post_id = url_to_postid( $url );
            if ( ! $post_id || tutor()->course_post_type !== get_post_type( $post_id ) ) {
                return $html;
            }
    
            if ( strpos( $html, '<iframe' ) !== false ) {
                $html = str_replace(
                    '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"',
                    '<iframe class="wp-embedded-content" sandbox="allow-forms allow-popups allow-scripts allow-same-origin allow-top-navigation" security="restricted" ',
                    $html
                );
    
                $html = preg_replace( '/( height=".*")/i', ' height="620" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" ', $html );
    
                $html = str_replace(
                    '<blockquote class="wp-embedded-content"',
                    '<blockquote class="wp-embedded-content" style="display:none" ',
                    $html
                );
                return $html;
            } else {
                return $html;
            }
        }
    metaphysician

    (@metaphysician)

    okay, none of what you added worked. i looked very carefully at the added code which looks like it was this:

    $post_id = url_to_postid( $url );
            if ( ! $post_id || tutor()->course_post_type !== get_post_type( $post_id ) ) {
                return $html;
            }

    as i have done a lot of testing on the embedding feature, i can confidently state that your Lesson Editor is disregarding <iframe> tagged HTML, where normally WP has no issues displaying these tags. additionally it keeps claiming ‘No video source selected from settings!’ and at least in the TutorLMS i have clearly selected YouTube Player under the Design tab in the Settings page. here’s a screencap video showing my problems – apologies for the lack of mouse pointer recording, but i think you’ll be able see the problem:

    https://www.dropbox.com/s/fcsnu0ozwr98dt0/TutorLMS-issues.mp4?dl=0

    so i think the problem goes a lot deeper than just editing the oembed_iframe_overrides function. that or when editing scripts and after saving with the plugin deactivated and then activating, maybe there’s an issue? i would assume editing scripts and re-activating the plugin would be the correct way to see the changes. anyway your team should know that not having iframe embeds is going to make me look elsewhere for LMS solutions in WP.

    Plugin Support Md. Jobayer Al Mahmud

    (@jobayertuser)

    Hello @metaphysician

    Thanks for your suggestions we are working on it.

    I am wondering about embedding YouTube videos to the instructor profile. I would like bio videos for each instructor. For example https://www.skillshare.com/en/user/maggie-stara?or https://outschool.com/teachers/Molly-Cranch not as large but you can see the idea. I would be open to another suggestion as well.

    Dear @2injoy

    I am very sorry to inform you that, at this moment you can’t use embed on the instructor Bio.

    Have a good day.

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘Tutor LMS removing my Youtube embeds’ is closed to new replies.