Diese Theme-Komponente ermöglicht es Benutzern, Medien in ein schwebendes Fenster „auszublenden", während sie die Seite durchsuchen. Sie können sogar zu einem anderen Thema navigieren, und die Medienwiedergabe läuft weiter.
Es funktioniert mit jedem <iframe> oder <video> (mit besonderer Behandlung für lazyYT). Es fügt jeder kompatiblen Komponente einen Button hinzu, der ein kleines Popup in der rechten unteren Ecke öffnet.
Anschließend können Sie es „minimieren", wodurch die Audiowiedergabe im Hintergrund weiterläuft, oder es vollständig schließen.
Derzeit wird die Größe des Videos durch die ursprüngliche Einbettung festgelegt. Ich möchte eine „Größenanpassung"-Funktion hinzufügen, entweder durch „Klicken und Ziehen" oder einfach über drei Buttons: „klein", „mittel", „groß".
Derzeit verdeckt dies den Editor. Die einfache Lösung ist, das Popup einfach zu schließen, wenn Sie einen Beitrag verfassen möchten .
I have fixed this with the addition of an explicit z-index, and some explicit colours. With the vincent theme it now looks like this when you mouse-over:
I tried enabling it on my forum and it makes the video box disappear completely when the video is oneboxed from a mp4 link.
I’ve also tested it with iframes and that makes it works as expected, but iframes are trickier to format properly
We just installed this so users could watch impeachment hearings without having to have another window open and it was such a hit (one comment was “This is very convenient. Amazing. This is by far the best forum interface I’ve ever experienced.”) that people on phones and tablets wanted it too. And since you can’t have multiple windows open on your mobile device, it’s a great feature to have.
To enable it on tablets and phones, just remove no-touch from lines 64 and 82 of Common CSS, and then resize the player on smaller screens with something like:
On touch devices, long-press = hover to bring up the control icon or the media controls, and then tap somewhere else to hide it again.
I was going to leave it off phones, but it’s still useful on a phone because you can listen to the audio with the player collapsed.
I assume this is a known limitation, but YouTubes won’t play audio when collapsed, and if you start to play a YouTube from the post and then decide to pop it out, there is no way to play the video in the floating window. You have to pop it out first without playing it, and then you can play it in the floating window.
It seems to work correctly with YouTube videos if you post them as an iFrame instead of just posting the link and using the Discourse lazyYT.
In order to for this to work, you must enable YouTube iFrames on your site. To do this go to Settings --> “allowed iframes” and whitelist https://www.youtube.com/
Then when you paste an iFrame code (you can find the iFrame code for any video on Youtube under Share --> Embed) the YouTube embedded via iFrame will be fully functional with the Media Overlay component. I.e. you need to post:
instead of https://www.youtube.com/watch?v=Ft1waA3p2_w
The iframe code won’t work on discourse.org because they haven’t whitelisted https://www.youtube.com in their “allowed iframes” settings, but it’s easy to add to your own forum.
Here’s how it looks on our forum on my phone with the media player expanded:
Die Media Overlay-Komponente verhinderte, dass Videos von Seiten wie Imgur in unserem Forum angezeigt wurden. Wir haben das Problem behoben, indem wir video aus Zeile 103 entfernt haben, also von $('iframe, video, .lazyYT', $elem) zu $('iframe, .lazyYT', $elem) geändert.
function addOverlays($elem) {
$('iframe, video, .lazyYT', $elem).wrap("<div class='media-overlay-eligable'></div>")
Jetzt funktionieren Imgur-Videos wieder, und das Overlay funktioniert weiterhin mit iFrames und lazyYTs.
Für Nutzer, die an dieser Funktion interessiert sind, bieten iOS Safari und Firefox dies bereits standardmäßig an, während Chrome dies für seine nächsten Versionen plant.