Closed Sobsz closed 1 year ago
Another issue I just realized: while Twitter would be unaffected, other services with iframe support (such as Mastodon) would. I've only just heard of OpenGraph, so I don't know if it's possible to provide both an iframe URL and a fallback MP4 one, but if not, the proposed feature should probably be toggleable.
Hi,
I'm not sure to understand: you say that updating twitter setting changes discord behaviour so I presume they use the twitter:card
tags no? Why would they also use opengraph tags?
Oh, I thought the setting changed the Open Graph tags too, but the diff doesn't lie... I guess Discord tries to embed with the Twitter tags first, then falls back to Open Graph once it notices it's an embed.
Some new notes:
og:video
tag and doesn't mention anything about iframes, so I'd be surprised if any platform accepts embed links there.Hello,
It's sad but we can't do anything here. Discord needs to adapt their whitelist or do not use a whitelist like Twitter that correctly embed PeerTube player. We prefer to not change our OpenGraph/Twitter card metadata to just work with Discord.
Based on what I understood :
Discord might not be the only social network having such a whitelist on iframes. There's no known way of adding an instance to the Discord whitelist.
What could be done is to expose the direct link in og:video:url
when the webpage is retrieved by a known whitelisted social media.
A flow could be :
Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)
when retrieving meta tags), PeerTube sets the og:video:url
to the direct link.
og:video:url
to the embed link.As far as I know the iframe-embeds are done by the html
attribute in the OEmbed response.
Describe the problem to be solved
Discord is mostly compatible with the Twitter embed format, but one area it differs in is
videoHTML embeds. Enabling video embeds for Twitter not only doesn't work for Discord, but it causes the embeds to go from a full-size static image:to this subjectively uglier-looking format:
Describe the solution you would like:
According to this comment from a Discord developer, arbitrary iframes cannot be embedded and the only way to embed a video is by providing a direct URL to the video file itself in the
og:video:url
meta tag.I've confirmed that copying the HLS URL from the
Download
section intoog:video
and related meta tags makes the video embed work in Discord, while still delivering the custom iframe (defined intwitter:player
) to Twitter users. However, there might be concern about the added "leech" factor due to viewers no longer being incentivized to view the video in the browser and thus participate in the P2P network.