ZionDevelopers / playx

In-game Internet (YouTube, Twitch, SoundCloud, mp4 and etc.) media player for Garry's Mod
http://steamcommunity.com/sharedfiles/filedetails/?id=106516163
Other
18 stars 14 forks source link

Host page problem #103

Closed drwu0818 closed 7 years ago

drwu0818 commented 7 years ago

The new host page will automatically initialize JWPlayer but that will broke flash and googledrive provider.

juliocoliveira commented 7 years ago

I'll need more then that. Like a video example with full URL on google drive, Screenshot, Lua errors and etc. It don't broke flash since Youtube plays just fine.

juliocoliveira commented 7 years ago

Well i see the problem, But i cannot give you a solution for it, Since the Flash provider injects HTML to the body of the page so doesn't matter whatever i have put on the PlayX host it will be replaced by PlayX Flash provider.

Your addon always worked, And even after i changed the PlayX host, And it stopped just a few days ago. I think i figured out what the problem is. When you play https://video.google.com/get_player?docid=0B0JMGMGgxp9WMEdWb1hyQUhlOWs&=docs&partnerid=30&cc_load_policy=1&controls=0&showsearch=0&showinfo=0&version=3&autoplay=1&rel=0&enablejsapi=1

But https://video.google.com/crossdomain.xml is stopping from the flash being played, Since as you can see

It only allow access from youtube.com domain.

You can learn more on http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html

And to you see that is not jwplayer or the host.html page the problem you can change the URL by typing playx_host_url "URL" on your server console, Like: playx_host_url "about:blank" or any other URL, But it doesn't matter since as i said before, PlayX injects other body HTML, As you can see on https://github.com/ZionDevelopers/playx/blob/master/lua/playxlib.lua#L589

So there is nothing i can do to fix that.

You will need change your Provider to another workaround, Like using Handler iFrame and URL https://drive.google.com/file/d/FILE_ID_HERE/preview like https://drive.google.com/file/d/0B0JMGMGgxp9WMEdWb1hyQUhlOWs/preview and then play it by javascript since any ?autoplay=1 don't seams to work.

Best luck to you.

drwu0818 commented 7 years ago

You just need add a check in your init.js, if video url is null then do not initialize JWPlayer.

juliocoliveira commented 7 years ago

Done, See if works now.

drwu0818 commented 7 years ago

Its work now, thanks!