PierfrancescoSoffritti / android-youtube-player

YouTube Player library for Android and Chromecast, stable and customizable.
https://pierfrancescosoffritti.github.io/android-youtube-player/
MIT License
3.44k stars 765 forks source link

Why is null being sent in the embed call? #1174

Closed memobeyle closed 1 month ago

memobeyle commented 1 month ago

Hello,

When youtube is played, it is called as follows, what is the reason, why is null sent and video id is not sent? I am using the latest version.

https://www.youtube.com/embed/null?autoplay=0&mute=0&controls=1&enablejsapi=1&fs=1&origin=https%3A%2F%2Fwww.youtube.com&rel=1&showinfo=0&iv_load_policy=1&modestbranding=1&cc_load_policy=1&widgetid=1

PierfrancescoSoffritti commented 1 month ago

Hi, where is this url coming from?

memobeyle commented 1 month ago

[INFO:CONSOLE(0)] "Access to XMLHttpRequest at 'https://googleads.g.doubleclick.net/pagead/viewthroughconversion/962985656/?backend=innertube&cname=56&cver=20241007&foc_id=w3NEf3k4D_cX0FMn49kqYw&label=followon_view&ptype=no_rmkt&random=654813613&cv_attributed=0' (redirected from 'https://www.youtube.com/pagead/viewthroughconversion/962985656/?backend=innertube&cname=56&cver=20241007&foc_id=w3NEf3k4D_cX0FMn49kqYw&label=followon_view&ptype=no_rmkt&random=654813613') from origin 'https://www.youtube.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.", source: https://www.youtube.com/embed/null?autoplay=0&mute=0&controls=1&enablejsapi=1&fs=1&origin=https%3A%2F%2Fwww.youtube.com&rel=1&showinfo=0&iv_load_policy=1&modestbranding=1&cc_load_policy=1&widgetid=1 (0)

In the previous version it was directly https://www.youtube.com/embed/? but here the null value was added. Shouldn't the video id be shown here?

PierfrancescoSoffritti commented 1 month ago

I don't think this has to do with the new version of the library. There is no video id in that log when the video player is initialized without a video, and the video is loaded at a later moment using loadVideo/cueVideo. Let me know if this is not the case.

memobeyle commented 1 month ago

I tried again for you, this time I provided the video id on the xml side, but it still does the same thing.

PierfrancescoSoffritti commented 1 month ago

When i try on the sample app, i see the video id in "Simple example" but don't see it in "Fullscreen example".

memobeyle commented 1 month ago

So, does this cause any harm? What do you suggest?

PierfrancescoSoffritti commented 1 month ago

I think it's fine. As mentioned above: There is no video id in that log when the video player is initialized without a video, and the video is loaded at a later moment using loadVideo/cueVideo

memobeyle commented 1 month ago

Thank you for your help.