Skip to content

Commit

Permalink
Add timestamp collection from Twitch VOD URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
slmnio committed Jan 21, 2022
1 parent 7f73765 commit 81331c3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion website/src/components/website/EmbeddedVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ export default {
return { service: "youtube", key: vodURL.pathname.slice(1), timestamp: vodURL.searchParams.get("t") || null };
}
if (["www.twitch.tv", "twitch.tv"].includes(vodURL.host)) {
return { service: (vodURL.pathname.split("/").length === 3 ? "twitch" : "twitch-live"), key: vodURL.pathname.slice(vodURL.pathname.lastIndexOf("/") + 1) };
const embed = {
service: (vodURL.pathname.split("/").length === 3 ? "twitch" : "twitch-live"),
key: vodURL.pathname.slice(vodURL.pathname.lastIndexOf("/") + 1)
};
if (embed.service === "twitch") {
embed.timestamp = vodURL.searchParams.get("t") || null;
}
return embed;
}
if (this.src.endsWith(".pdf")) {
Expand Down

0 comments on commit 81331c3

Please sign in to comment.