Skip to content

Commit c99695b

Browse files
committed
Update youtube_meta.html
1 parent 5db6460 commit c99695b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

public/youtube_meta.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- 👋👋👋 Hello dear code reader, have fun understanding how YT works without ads. -->
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width,initial-scale=1" />
8-
<title>YT Minimal Player</title>
8+
<title>YT Minimal Player (Metadata)</title>
99

1010
<link rel="dns-prefetch" href="//www.youtube.com">
1111
<link rel="dns-prefetch" href="//www.youtube-nocookie.com">
@@ -57,7 +57,7 @@
5757
modestbranding: 1, // Reduce branding
5858
enablejsapi: 1, // Enable JS API for custom controls
5959
muted: 1, //Set to play muted
60-
autoplay: 0 //Set to make it autostart
60+
autoplay: 1 //Set to make it autostart
6161
};
6262

6363
function onYouTubeIframeAPIReady() {
@@ -81,11 +81,12 @@
8181
host: 'https://www.youtube-nocookie.com',
8282
events: {
8383
onReady: () => {
84+
8485
const videoData = player.getVideoData()
8586
const metadata = {
8687
title: videoData.title,
8788
isLive: videoData.isLive,
88-
duration: player.getDuration(),
89+
duration: player.getCurrentTime(),
8990
};
9091

9192
console.log("METADATA:" + JSON.stringify(metadata));

0 commit comments

Comments
 (0)