Merge pull request #659 from marcbelletre/master

Add Ausha service
This commit is contained in:
Amauri CHAMPEAUX 2021-04-13 18:39:49 +02:00 committed by GitHub
commit 24da85ad37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 41 additions and 0 deletions

View File

@ -3874,3 +3874,44 @@ tarteaucitron.services.woopra = {
woopra.track();
}
};
// ausha
tarteaucitron.services.ausha = {
key: "ausha",
type: "video",
name: "Ausha",
uri: "https://www.ausha.co/protection-personal-data/",
needConsent: true,
cookies: [],
js: function () {
"use strict";
tarteaucitron.fallback(['ausha_player'], function (x) {
var player_height = x.getAttribute('data-height'),
podcast_id = x.getAttribute('data-podcast-id'),
player_id = x.getAttribute('data-player-id'),
playlist = x.getAttribute('data-playlist'),
color = x.getAttribute('data-color');
if (podcast_id === undefined) {
return "";
}
var src = 'https://player.ausha.co/index.html?podcastId=' + podcast_id + '&v=3';
if (playlist && playlist.length > 0) src += '&playlist=' + playlist;
if (color && color.length > 0) src += '&color=' + color.replace('#', '%23');
if (player_id && player_id.length > 0) src += '&playerId=' + player_id;
return '<iframe id="' + player_id + '" loading="lazy" width="100%" height="' + player_height + '" scrolling="no" frameborder="no" src="' + src + '"></iframe>';
});
tarteaucitron.addScript('//player.ausha.co/ausha-player.js', 'ausha-player');
},
fallback: function () {
"use strict";
tarteaucitron.fallback(['ausha_player'], function (elem) {
elem.style.height = elem.getAttribute('data-height') + 'px';
return tarteaucitron.engage('ausha');
});
}
};