• Resolved Bart

    (@boiert)


    I have tried and failed to properly embed a PeerTube video.
    The point at which it fails is the sandbox on the eventual iframe, that needs: allow-same-origin to be flagged as an exemption, next to the already provided allow-scripts.

    Now I don’t want to hack around the issue by, for example, including scripts that would set that attribute on the iframe. There needs to be a proper (clean) fix, right?

    The same issue happens when using the “federated reply” block.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @boiert

    I noticed that the code that appears in your page is slightly different than the code you can get from a PeerTube video. If you go to the PeerTube site, open the video you want to add, and click on the “Share” icon, you can go to the “Embed” tab where you can find the HTML code that is required to add that video into your WordPress pages.

    For the default WordPress page builder, you only need to add one “HTML block” paste that code there. I tried this using a generic PeerTube video and it worked just fine. Please try it too.

    Kind regards,
    Jair.

    Thread Starter Bart

    (@boiert)

    Hello Jair,

    Thanks for your hints!
    I’ve tried both embedding the ‘proper’ embed URL in an embed block, and below it added a custom HTML block. Now that would show nothing if I didn’t wrap it in a <div>! <iframe> is just plainly stripped. No trace of it, not even in the editor when re-opening the post for editing!

    <div class="embed-iframe-peertube"><iframe title="Camera-toe-zicht" width="560" height="315" src="https://spectra.video/videos/embed/wkjbBoBnT2vzUU3ysKvMVh" allow="fullscreen" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" style="border: 0px;"></iframe></div>

    Was what I ended up with because I first thought that my eyes deceived me.

    <div class="embed-iframe-peertube"></div>

    Is what remains, in the editor and on the page.

    Also, the ‘proper’ embed url does not work for a Federated Reply, but I would believe that to be a PeerTube issue.

    Thank you!

    • This reply was modified 3 months, 3 weeks ago by Bart. Reason: Updated the website, and informing of the Federated Reply

    Hello Bart,

    WordPress might be removing the code for security reasons.

    You can try to add the same iframe with a plugin like this one:
    https://ww.wp.xz.cn/plugins/iframe/

    After activating the plugin it should allow embedding a video using a shortcode like:
    [embed]https://spectra.video/videos/embed/wkjbBoBnT2vzUU3ysKvMVh[/embed]

    Hope this helps.

    Best Regards,
    Dmytro

    Thread Starter Bart

    (@boiert)

    I’ve started querying the host(s) on that issue. Adding a plugin is also not an option I have.
    In the meantime I’m hosting the videos on our own server, which doesn’t do all the fancy things like optimized encoding for internet distribution, automatic subtitles and such luxuries.

    Thank you for the alternatives, I hope they will be useful for someone else!

    Kind regards,
    Bart

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.