You haven’t explained what fGetYTVideoURL()
returns, but assuming it returns a URL like this…
https://www.youtube.com/embed/Np1zODg5cqc
…or this…
https://www.youtube.com/watch?v=Np1zODg5cqc
…it will not work because those URLs don’t return video files; they return HTML. You might be tempted to look at you network traffic and see what the actual video file is that is being loaded by that html – you’ll get a URL like this…
https://r1---sn-a5mlrnez.googlevideo.com/videoplayback?expire=1582344221&ei=vVNQXoW8HK2HsfIProyj-AQ&ip=2605%3Ae000%3A1300%3Accbf%3A601f%3Abac2%3A86d%3Af319&id=o-AFEgdOdX_5nywyslbWmvXc8EF0y8HeYrW_yPY3wd98R1&itag=251&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-a5mlrnez%2Csn-a5mekne7&ms=au%2Crdu&mv=m&mvi=0&pl=32&ctier=A&pfa=5&initcwndbps=1996250&hightc=yes&vprv=1&mime=audio%2Fwebm&gir=yes&clen=74990971&dur=4915.521&lmt=1553137923147156&mt=1582322550&fvip=1&keepalive=yes&fexp=23842630&c=WEB&txp=5511222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cctier%2Cpfa%2Chightc%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRQIgAfkeocLbpR_yTfM0pRxO7v0cMbWBal9Q0q-2yWVuMKgCIQDSPdGgVR0LbO9I7f_a-O1_mzHaKamKx-6W4O_haVRacg%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRgIhAOBXzU7y8eiJmEZ5Rvxhh0KVRSqzIxbTXbT-mISW83uYAiEAxp_9CQXc3h7oyP6oTwMAMnGx5xodz_H9pQCxl46uUbY%3D&alr=yes&cpn=hnkKLzqdWZEqssJZ&cver=2.20200221.03.00&range=8625073-9116485&rn=13&rbuf=31586
…and the problem with that URL is it’s designed by one of the largest companies in the world to keep people from accessing it directly. (Also, different browsers need different media formats, so even if that video played on your browser, there’s no guarantee it’d play on someone else’s.)