File tree Expand file tree Collapse file tree 1 file changed +13
-19
lines changed
Expand file tree Collapse file tree 1 file changed +13
-19
lines changed Original file line number Diff line number Diff line change 1616 html , body {
1717 margin : 0 ;
1818 padding : 0 ;
19- width : 25 % ;
20- height : 25 % ;
19+ width : 1 px ;
20+ height : 1 px ;
2121 overflow : hidden;
2222 }
2323
2424 # player-container {
25- width : 25 % ;
26- height : 25 % ;
25+ width : 1 px ;
26+ height : 1 px ;
2727 position : fixed;
2828 top : 0 ;
2929 left : 0 ;
5959 modestbranding : 1 , // Reduce branding
6060 enablejsapi : 1 , // Enable JS API for custom controls
6161 muted : 1 , //Set to play muted
62- autoplay : 1 //Set to make it autostart
62+ autoplay : 0 //Set to make it autostart
6363 } ;
6464
6565 function onYouTubeIframeAPIReady ( ) {
8383 host : 'https://www.youtube-nocookie.com' ,
8484 events : {
8585 onReady : ( ) => {
86- player . setVolume ( 0 )
87- } ,
88- onStateChange : ( event ) => {
89- if ( event . data === YT . PlayerState . PLAYING ) {
90-
91- const videoData = player . getVideoData ( )
92- const metadata = {
93- title : videoData . title ,
94- isLive : videoData . isLive ,
95- duration : Math . round ( player . getDuration ( ) ) ,
96- } ;
97-
98- console . log ( "METADATA:" + JSON . stringify ( metadata ) ) ;
99- }
86+ const videoData = player . getVideoData ( ) ;
87+ const metadata = {
88+ title : videoData . title ,
89+ isLive : videoData . isLive ,
90+ duration : Math . round ( player . getDuration ( ) ) ,
91+ } ;
92+
93+ console . log ( "METADATA:" + JSON . stringify ( metadata ) ) ;
10094 } ,
10195 onError : ( event ) => {
10296 const YT_ERROR_CODES = {
You can’t perform that action at this time.
0 commit comments