mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
improve beacon
This commit is contained in:
parent
f2e527cceb
commit
1047b16303
1 changed files with 13 additions and 5 deletions
|
@ -467,9 +467,17 @@ function addViewBeacon() {
|
||||||
beacon.src = url;
|
beacon.src = url;
|
||||||
console.log('addViewBeacon will be sent', mediaId, playerCurrentTime, seconds_watching_video, beacon);
|
console.log('addViewBeacon will be sent', mediaId, playerCurrentTime, seconds_watching_video, beacon);
|
||||||
_addViewBeaconAdded = true;
|
_addViewBeaconAdded = true;
|
||||||
}else{
|
} else {
|
||||||
|
if (typeof mediaId !== 'undefined') {
|
||||||
console.log('addViewBeacon mediaId is undefined');
|
console.log('addViewBeacon mediaId is undefined');
|
||||||
}
|
}
|
||||||
|
if (typeof playerCurrentTime !== 'undefined') {
|
||||||
|
console.log('addViewBeacon playerCurrentTime is undefined');
|
||||||
|
}
|
||||||
|
if (typeof seconds_watching_video !== 'undefined') {
|
||||||
|
console.log('addViewBeacon seconds_watching_video is undefined');
|
||||||
|
}
|
||||||
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1259,7 +1267,7 @@ function checkDescriptionArea() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
window.addEventListener('beforeunload', function(e) {
|
window.addEventListener('beforeunload', function (e) {
|
||||||
console.log('window.addEventListener(beforeunload');
|
console.log('window.addEventListener(beforeunload');
|
||||||
addViewBeacon();
|
addViewBeacon();
|
||||||
}, false);
|
}, false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue