File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 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 ">
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 ( ) {
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 ) ) ;
You can’t perform that action at this time.
0 commit comments