Skip to content

Commit 17cbaf4

Browse files
committed
consent manager logging added
1 parent 26c189a commit 17cbaf4

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

assets/vidstack_helper.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,34 @@
1818
let videoConsent = JSON.parse(localStorage.getItem(consentKey) || '{}');
1919

2020
function setConsent(platform) {
21+
// Vidstack eigenes Consent-System
2122
videoConsent[platform] = true;
2223
localStorage.setItem(consentKey, JSON.stringify(videoConsent));
2324
document.cookie = `${platform}_consent=true; path=/; max-age=${30 * 24 * 60 * 60}; SameSite=Lax; Secure`;
25+
26+
// Optional: Consent Manager Logging (falls installiert)
27+
if (typeof consent_manager_util !== 'undefined') {
28+
// Nutze Standard-UIDs: 'youtube' oder 'vimeo'
29+
try {
30+
// API Call für DSGVO-konformes Logging
31+
fetch('?rex-api-call=consent_manager_inline_log', {
32+
method: 'POST',
33+
headers: {
34+
'Content-Type': 'application/x-www-form-urlencoded',
35+
},
36+
body: new URLSearchParams({
37+
service: platform,
38+
consent_type: 'inline',
39+
source: 'vidstack'
40+
})
41+
}).catch(err => console.warn('Vidstack: Consent Manager Logging fehlgeschlagen', err));
42+
43+
// Consent Manager Cookie setzen (parallel zu Vidstack)
44+
consent_manager_util.set_consent(platform);
45+
} catch (e) {
46+
console.warn('Vidstack: Consent Manager Integration Fehler', e);
47+
}
48+
}
2449
}
2550

2651
function hasConsent(platform) {

0 commit comments

Comments
 (0)