Spent the day pulling my hair, wondering why certain videos would not load using the YouTube player API in my loadscreen resource.
Found that the same video/embed would work while testing the page as UI (ui_page
in fxmanifest.lua
), and noted the only difference seems to be the “origin” provided to the embed.
Apparently this is a problem as the YouTube player will only accept https://
urls as the origin, and loadscreens still use the old nui://
url.
Example image of the two iframe elements:
Note the top is defined as a UI page, while the second is defined as a loadscreen.
Reproduction steps:
Create a resource with a ui_page, and add the following embed to it:
<iframe width="560" height="315" src="https://www.youtube.com/embed/ENpEEpBAuM4" frameborder="0" gesture="media" allow="autoplay; encrypted-media" allowfullscreen></iframe>
You will notice the iframe has no problems loading.
Now change the resource to a loadscreen, and observe the following error:
Is there any way that we can get the https://
origin assigned to loadscreens as well? I think this will resolve the issue entirely.