add social webseite
This commit is contained in:
28
app.js
Normal file
28
app.js
Normal file
@@ -0,0 +1,28 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var TWITCH_CHANNEL = "duda_xd";
|
||||
|
||||
/* ------------------------------------------------------------------
|
||||
* Twitch: Live-Player einbetten. Zeigt automatisch den aktuellen
|
||||
* Stream, sobald du live bist. Die Domain wird dynamisch gesetzt,
|
||||
* damit der Player ueberall funktioniert (auch lokal).
|
||||
* Twitch ist ein iframe-Embed -> keine CORS-Probleme.
|
||||
* ------------------------------------------------------------------ */
|
||||
function loadTwitch() {
|
||||
var wrap = document.getElementById("twitch-embed");
|
||||
if (!wrap) return;
|
||||
|
||||
var domain = window.location.hostname || "localhost";
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.src = "https://player.twitch.tv/?channel=" + TWITCH_CHANNEL +
|
||||
"&parent=" + domain + "&muted=true";
|
||||
iframe.setAttribute("title", "Twitch Stream");
|
||||
iframe.setAttribute("allowfullscreen", "true");
|
||||
iframe.setAttribute("scrolling", "no");
|
||||
iframe.setAttribute("allow", "autoplay; fullscreen");
|
||||
wrap.appendChild(iframe);
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", loadTwitch);
|
||||
})();
|
||||
Reference in New Issue
Block a user