tjallingt/react-youtube

Problem with opts

Opened this issue · 2 comments

I'm getting a problem when first rendering my component, I didn't get the error on my opts
Screenshot_1
Screenshot_2
.

I have the same issue. However if I give them directly into the opts as an object it seems to work as a temporary workaround.

you can get past the error by typing the playervars options as constants like so:

      const opts = {  
        height: '390',   
        width: '640',  
        playerVars: {  
          // https://developers.google.com/youtube/player_parameters  
          autoplay: 1 as const,
          controls: 1 as const,
          disablekb: 1 as const,
          iv_load_policy: 3 as const,
          fs: 0 as const,
        },
      }