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