-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(WCOStream): fix presence & remove broken code (#8277)
* fix(WCOStream): fix presence & remove broken code * fix(WCOStream): fix presence
- Loading branch information
Dark_Ville
authored
Apr 16, 2024
1 parent
2b8dc9f
commit 73e2f86
Showing
3 changed files
with
51 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
const iframe = new iFrame(); | ||
|
||
iframe.on("UpdateData", async () => { | ||
if (document.querySelector<HTMLVideoElement>("#video-js_html5_api")) { | ||
const video = document.querySelector<HTMLVideoElement>("video"); | ||
if (video) { | ||
iframe.send({ | ||
paused: document | ||
.querySelector<HTMLButtonElement>( | ||
"#video-js > div.vjs-control-bar > button" | ||
) | ||
.title.includes("Play"), | ||
timeLeft: document.querySelector<HTMLSpanElement>( | ||
"span.vjs-remaining-time-display" | ||
).textContent, | ||
paused: video?.paused, | ||
timeLeft: | ||
document.querySelectorAll('[role="timer"]')?.[1]?.textContent ?? | ||
document.querySelector(".vjs-remaining-time-display")?.textContent, | ||
}); | ||
} else { | ||
iframe.send({ | ||
titleV: | ||
document.querySelector(".video-title")?.textContent ?? | ||
document.querySelector('[property="og:title"]')?.textContent, | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters