|
@@ -25,6 +25,46 @@ tarteaucitron.services.addthis = {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// youtube
|
|
|
+tarteaucitron.services.youtube = {
|
|
|
+ "key": "youtube",
|
|
|
+ "type": "social",
|
|
|
+ "name": "YouTube",
|
|
|
+ "uri": "https://www.google.fr/intl/fr/policies/privacy/",
|
|
|
+ "needConsent": true,
|
|
|
+ "js": function () {
|
|
|
+ "use strict";
|
|
|
+ tarteaucitron.fallback(['youtube_player'], function (x) {
|
|
|
+ var video_id = x.getAttribute("videoID");
|
|
|
+ if ( video_id === undefined ) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ var video_width = x.getAttribute("width");
|
|
|
+ var frame_width = 'width=';
|
|
|
+ if ( video_width !== undefined ) {
|
|
|
+ frame_width+= '"'+video_width+'" ';
|
|
|
+ } else {
|
|
|
+ frame_width+= '"" ';
|
|
|
+ }
|
|
|
+ var video_height = x.getAttribute("height");
|
|
|
+ var frame_height = 'height=';
|
|
|
+ if ( video_height !== undefined ) {
|
|
|
+ frame_height+= '"'+video_height+'" ';
|
|
|
+ } else {
|
|
|
+ frame_height+= '"" ';
|
|
|
+ }
|
|
|
+ var video_frame = '<iframe id="ytplayer" type="text/html" '+ frame_width + frame_height +'" src="http://www.youtube.com/embed/'+ video_id +' " frameborder="0"/>';
|
|
|
+ return video_frame;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ "fallback": function () {
|
|
|
+ "use strict";
|
|
|
+ var cookies = ['VISITOR_INFO1_LIVE', 'YSC', 'PREF', 'GEUP'],id = 'youtube';
|
|
|
+ tarteaucitron.cookie.purge(cookies);
|
|
|
+ tarteaucitron.fallback(['youtube_player'], tarteaucitron.engage(id));
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
// clicky
|
|
|
tarteaucitron.services.clicky = {
|
|
|
"key": "clicky",
|