Update html/watch.ejs
This commit is contained in:
parent
0b1fa1d5ba
commit
3f4f7c7aa2
@ -2428,14 +2428,16 @@ if (/[?&]autoplay=/.test(location.search)) {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
function sendStats(videoId) {
|
||||||
function sendStats(videoId) {
|
|
||||||
if (!videoId) return
|
if (!videoId) return
|
||||||
|
|
||||||
if (window.__pokeStatsSent) return
|
let userId = localStorage.getItem("poke_uid")
|
||||||
window.__pokeStatsSent = true
|
if (!userId) {
|
||||||
|
userId = "u_" + Math.random().toString(36).slice(2) + Date.now()
|
||||||
|
localStorage.setItem("poke_uid", userId)
|
||||||
|
}
|
||||||
|
|
||||||
const payload = { videoId }
|
const payload = { videoId, userId }
|
||||||
|
|
||||||
fetch("/api/stats", {
|
fetch("/api/stats", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@ -2445,6 +2447,7 @@ if (/[?&]autoplay=/.test(location.search)) {
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sendStats(new URLSearchParams(location.search).get("v"))
|
sendStats(new URLSearchParams(location.search).get("v"))
|
||||||
|
|
||||||
function toggleTheaterMode() {
|
function toggleTheaterMode() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user