Trying to get Rumble Videos To work.

Eric Croskey Posted in Technical Support 3 months ago

I'm following along with the Bitchute code and made a few changes. I can grab the link, but not the video itself. Anyone have a clue as to what I'm doing wrong?

In OssnEmbed > ossn_com.php I've added:

    '/(https?:\/\/)(www\.)?(rumble.com\/embed\/)([0-9a-zA-Z_-]*)/',

And in ossnembed.lib.php I've added aroound line 115

    case 'rumble':
                $videodiv .= "<iframe src=\"https://www.rumble.com/embed/{$url}\" width=\"$width\" height=\"$height\" allowfullscreen></iframe>";
                break;

Around line 341

       /**
 * main rumble interface
 *
 * @param string $url
 * @param integer $guid unique identifier of the widget
 * @param integer $videowidth  optional override of admin set width
 * @return string css style, video div, and flash <object>
 */
function ossn_embed_rumble_handler($url, $guid, $videowidth) {
    // this extracts the core part of the url needed for embeding
    $videourl = ossn_embed_rumble_parse_url($url);
    if (!isset($videourl)) {
        return false;
    }

    // aspect ratio changes based on video - need to investigate
    ossn_embed_calc_size($videowidth, $videoheight, 400/300, 0);

    $embed_object = ossn_embed_add_css($guid, $videowidth, $videoheight);

    $embed_object .= ossn_embed_add_object('rumble', $videourl, $guid, $videowidth, $videoheight);

    return $embed_object;
}

/**
 * parse rumble url
 *
 * @param string $url
 * @return string hash
 */
function ossn_embed_rumble_parse_url($url) {
    // separate parsing embed url
    if (strpos($url, 'object') != false) {
        return ossn_embed_rumble_parse_embed($url);
    }
    if (preg_match('/(https:\/\/)(www\.)?(rumble.com\/embed\/)([0-9a-zA-Z_-]*)/', $url, $matches)) {
            // that's the "embed" link suggested by bitchete
            return $matches[4];
    }

}
Replies
German Michael Zülsdorff Replied 3 months ago

I don't understand which way you're getting the icon shown in your screenshot with free Ossn 6.3 It's part of LinkPreview.

us Eric Croskey Replied 3 months ago

Okay. I just don't get it. I did a sandbox install of 6.3 free and I'm still getting the exact same result as I have with the prem. which is live. I don't know how you got this work Michael.

German Michael Zülsdorff Replied 3 months ago

No, because I don't believe that copy/pasting your own code again would make any difference.
The difference I see is: I'm running a plain vanilla Ossn 6.3 Free, while you are running the Premium version which comes with a lot of extra components which might interfere with OssnEmbed.
LinkPreview is such a candidate (as your screenshot shows), thus the only advice I can give is to temporarely disable all these Premium extras in question and repost the rumble link again.

us Eric Croskey Replied 3 months ago

Michael, is there any chance I can get a full copy of your code for both files? I'm still getting this.
enter image description here

German Michael Zülsdorff Replied 3 months ago

Eric, the code above is working fine for me.
You simply missed to call your own handler:

    } else if (strpos($url, 'rumble.com') != false) {
    return ossn_embed_rumble_handler($url, $guid, $videowidth);

(inserted at line 59 of the library) 😅
enter image description here

us Eric Croskey Replied 3 months ago

I'm working from the shortened link which is found from the embed button on rumble.

I changed the code on ossn-com.php to show:

'/(https?:\/\/)(www\.)?(rumble.com\/embed\/)([0-9a-zA-Z_-]*)/[?]pub=4',

but it's still not grabbing the video. Anyone else have an idea how to fix this? I'm at about the end of my knowledge on this one.

Indonesian Arsalan Shah Replied 3 months ago

First make sure rumble allow embed. Then study their URL structure and way of parsing their URL.

Edited

I have checked rumble the URL of actual video of rumble and the embed code as Iframe are different URL there is no way you can find the ID of video for iframe using the actual video URL.

Example URL https://rumble.com/vrfgfp-cute-and-funny-cat-videos-to-keep-you-smiling-.html
Have embed URL https://rumble.com/embed/votabt/?pub=4 which is different and there is no where in actual URL you find vrfgfp what you can do is to add a parser for embed URL instead. So if someone enters https://rumble.com/embed/votabt/?pub=4 it shows video instead.