Youtube Iframe on HTTPS website

后端 未结 1 1966
青春惊慌失措
青春惊慌失措 2021-02-15 17:07

I included an iframe pointing to a youtube video on a website using https. Although I embedded the youtube video with \"https://\", the video loads http-files when I click on pl

1条回答
  •  闹比i
    闹比i (楼主)
    2021-02-15 17:35

    Add a origin parameter to your URL as explained from the Google api documentation: YouTube Player API Reference for iframe Embeds

    As an extra security measure, you should also include the origin parameter to the URL, specifying the URL scheme (http:// or https://) and full domain of your host page as the parameter value. While origin is optional, including it protects against malicious third-party JavaScript being injected into your page and hijacking control of your YouTube player.

     
    

    0 讨论(0)
提交回复
热议问题