I plan to measure network traffic when playing video. This, of course, will only work when the video is transmitted via HTTP instead of HTTPS.
However, the YouTube iframe API always switches to HTTPS download, even though I download the API from http:// and specify the YouTube URL using http:// . You can use the example here to test the player. As you can see, it always switches to https://videoplayback... that I want to disable.
How to make it use HTTP instead of HTTPS? This is a kind of reverse question about this . I guess this will lead to some hacking functions in the current JS.
In the widget's API, I see calls such as:
b = 0 == c.indexOf("https:") ? [c] : bd ? [c.replace("http:", "https:")] : bk ? [c] : [c, c.replace("http:", "https:")];
and
if (this.d = !!("https:" == document.location.protocol || a && 0 == a.src.indexOf("https:"))) { a = [this.j, window.YTConfig || {}, this.defaults]; for (var b = 0; b < a.length; b++) a[b].host && (a[b].host = a[b].host.replace("http://", "https://")) }
but I donโt know where to override this in the context of YT and YT.Player , or if I can even do it.
Who cares if this is possible on the server side: Please note that YouTube only works with HTTP. If you are not logged into YouTube and switched to http://youtube.com , your videos will be displayed in HTTP format, not HTTPS.
source share