YouTube is able to autoplay in browsers with the same media engagement score chrome://media-engagement as PeerTube because YouTube has been hard-coded as trusted into browsers based on a dynamically generated list using a variety of trust signals that marks YouTube as a trusted media site Chromium Preseeding
Therefore the only way to resolve the discrepancy is to add PeerTube to the preseeding which can only be done by increasing the global traffic and trust signals that PeerTube has. To confirm this I ran a test with both YouTube and PeerTube having the same Media Engagement score and YouTube is able to play but PeerTube is not because YouTube has a hard-coded trust signal built into the source code.
Edited
Designs
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Aside from improving the Pre-seeded Media Engagement score of PeerTube, the only other idea I have is to have a pop-up when a video is shared that alerts the user that they need to unmute and then upon a button press to unmute the video using javascript.
Uh, so it seems hard to cheat with the Media Engagement. Yes some kind of pop-up may be a solution, but it is not about unmute but autoplay, right? Where is this pre-seeded trust list generated by Google? How much more trust does Youtube have?
Yea so we do not have the ability to see the Pre-Seeded list as far as I can determine, YouTube basically has a free pass that gets every browser on Earth to Trust it even if the user has never seen YouTube before. The media engagement score only matters if the site is not on the pre-seeded list.
The media engagement score needs to be "high" which is a browser preference I think the default is 0.3 but according to Googles documentation it takes 6-12 visits before a site has "high" trust with a user using default preferences.
So because the browser is already streaming video and audio from Jitzy it seems like it could be possible to stream a shared video from within the participant feed and that might work as in theory the user has already given permission for audio & video for that feed. Currently video sharing is an iframe rather than a part of the existing participant feed.
The player seems to autostart only if a user has done an interaction on the player (and Youtube has an exception).
@oliver.maklott suggests to transmit a start signal via WebRTC, that we fetch via Javascript and inject into the iFrame. Or use the PeerTube SDK to trigger the play.
If you are referring to using the existing video feed thats already streaming unmuted audio from participants then sure, if you mean a separate iframe feed then it wont work for the following reasons:
So WebRTC is just an API within the browser that uses the WebRTC protocol to communicate. Which means the browser has control over whether a signal starts using WebRTC and the same rules regarding user interaction applies.
Javascript injection into an iFrame also does not work without say a user clicking a popup as of a few years ago due to changes in the browser.
The PeerTube SDK cannot trigger a play as the browser retains control over media.
Ultimately due to changes a few years ago any javascript injection (synthetic gestures such as .click()) or API calls without a real user gesture such as clicking a popup to unmute will not work. The key is that the browser ultimately has complete control over whether or not media plays, as media is just bytes streaming over the internet, but your computer ultimately always decides what to do with it.
I did test on Firefox, same behaviour, I didn't check the media score but the same issue exists where YouTube always works but PeerTube doesn't and the only difference is essentially the source of the video. Also the video autoplays while muted which is exactly what we would expect if the browser was preventing unmuted only videos from a non-preseeded website.
WebRTC might work but the participants feed is already a WebRTC instance? So to me the solution is just tapping into the existing stream and streaming from Peertube into the server and into the existing WebRTC feed rather than an iframe which triggers the permissions issue.
We need the features that peertube has - subtitles, selecting subtitles. So I'm thinking if we really can't use an iframe maybe we can use some peertube SDK? PeerTube is written in angular and jitsi in react but I think they should be compatible in one way or another it's just more work than embedding an iframe, we could also reimplement subtitles but I think that's a bit out of scope...
work for me in firefox an chrome with iframes showing youtube peertube.tv and displeu.video, as long as the videos are muted
<head><title>test</title></head><body><iframewidth="560"height="315"src="https://www.youtube.com/embed/5PimUvzMIDI?autoplay=1&mute=0"title="YouTube video player"frameborder="0"allow="autoplay"referrerpolicy="strict-origin-when-cross-origin"allowfullscreen></iframe><iframesrc="https://www.youtube.com/embed/1O0yazhqaxs?autoplay=1&mute=1"width="560"height="315"title="3 Second Video"allow="autoplay"frameborder="0"></iframe><iframetitle="TEN Transport Evolved News Episode 524: What's Happened To The EPA?"width="560"height="315"src="https://peertube.tv/videos/embed/044b4834-eb66-47ed-bfbb-c189bd1c5ddd?autoplay=1&muted=1"frameborder="0"allowfullscreen=""sandbox="allow-same-origin allow-scripts allow-popups"allow="autoplay"></iframe><iframetitle="European Defence disunited in adversity"width="560"height="315"src="https://displayeurope.video/videos/embed/d9b68508-ed19-4f63-bf7d-2220c831e1f6?autoplay=1&muted=1"frameborder="1"allowfullscreen=""sandbox="allow-same-origin allow-scripts allow-popups allow-forms"allow="autoplay"></iframe></body>
media-engagement is just one magic, iframe delegation is another cleaner solution.
I haven't played around with iframe delegation yet
but as I understand it, the parent website has to ask for the permission, to be then able to delegate it to an embedded iframe, so I guess, you need some JS in the parent sitze to bring up e.g. an allow autoplay dialog, or maybe its enough to just set a header to the webserver serving the parent page(https://developer.chrome.com/docs/privacy-security/permissions-policy#usage)
Yea we know it works muted, that is the expected behaviour. The iframe origin still needs the same media engagement score to have autoplay permission. The easiest solution does seem to be some kind of real user movement like a popup + synthetic javascript which in theory should allow the video to be unmuted as soon at it starts playing.
yes, I think some kind of popup will be required, as the iframe delegation method, would need all allowed iframe video source domains whitelisted in the header of the parent pages webserver,
which is difficult, as peertube is federated and the content is spread across multiple systems