Skip to content

Commit

Permalink
Merge pull request PreMiD#3062 from gfjaru/catchplay
Browse files Browse the repository at this point in the history
Catchplay Update
  • Loading branch information
mergify[bot] authored Feb 21, 2021
2 parents ca3005e + a5d4576 commit 56a3677
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion websites/C/CatchPlay/dist/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"en": "CatchPlay is a Taiwanese multimedia company founded in 2007, whose businesses include OTT VOD streaming service operation, linear television channel operation (CatchPlay Movie Channel) and theatrical film distribution."
},
"service": "CatchPlay",
"version": "1.0.1",
"version": "1.0.2",
"logo": "https://i.imgur.com/hAt97QK.png",
"thumbnail": "https://i.imgur.com/vaaItvT.png",
"color": "#F26F21",
Expand All @@ -21,5 +21,13 @@
"video",
"media"
],
"settings": [
{
"id": "buttons",
"title": "Show Presence Buttons",
"icon": "fas fa-th-large",
"value": true
}
],
"category": "videos"
}
8 changes: 7 additions & 1 deletion websites/C/CatchPlay/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ function getTimestamps(
presence.on("UpdateData", async () => {
const data: PresenceData = {
largeImageKey: "cp"
};
},
buttons = await presence.getSetting("buttons");

if (document.location.pathname.includes("/watch")) {
const video: HTMLVideoElement = document.querySelector(".player-box video");
if (buttons) data.buttons = [{
label: 'Watch',
url: document.URL
}];
if (video && !isNaN(video.duration)) {
if (document.querySelector(".CPplayer-header-subtitle")) {
data.state =
Expand Down

0 comments on commit 56a3677

Please sign in to comment.