From 3bf2fc6c0900645e70035129fac49e4da94bb422 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Wed, 9 Aug 2023 16:59:13 +0200 Subject: [PATCH] Add Twitch Fix #1133 --- tarteaucitron.services.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 6c2266b..240e253 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -37,6 +37,32 @@ tarteaucitron.services.iframe = { } }; +// twitch +tarteaucitron.services.twitch = { + "key": "twitch", + "type": "video", + "name": "Twitch", + "needConsent": true, + "cookies": [], + "uri": "https://www.twitch.tv/p/en/legal/privacy-notice", + "js": function () { + "use strict"; + tarteaucitron.fallback(['twitch_player'], function (x) { + var id = x.getAttribute('videoID'), + parent = x.getAttribute('parent'), + width = x.getAttribute('width'), + height = x.getAttribute('height'); + var embedURL = "https://player.twitch.tv/?video=" + id + "&parent=" + parent; + return ""; + }); + }, + "fallback": function () { + "use strict"; + var id = "twitch"; + tarteaucitron.fallback(["twitch_player"], tarteaucitron.engage(id)); + } +}; + // eskimi tarteaucitron.services.eskimi = { "key": "eskimi",