• Playing youtube through gmod
    18 replies, posted
I can't really figure this out and I have tried ways that just didn't work for me I need some help with this :/
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/OpenURL]Panel:OpenURL[/url]? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/gui/OpenURL]gui.OpenURL[/url]? Use either of those to open a website such as YouTube, if this is what you mean.
I just want the sound from youtube that I could play with [URL="http://wiki.garrysmod.com/page/sound/PlayURL"]sound.PlayURL[/URL]. Just cannot find a way to do it
[QUOTE=Martin132;52676675]I just want the sound from youtube that I could play with [URL="http://wiki.garrysmod.com/page/sound/PlayURL"]sound.PlayURL[/URL]. Just cannot find a way to do it[/QUOTE] Find an API that can convert it, fetch it with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/http/Fetch]http.Fetch[/url] and use the success function to play the sound if it's URL is valid.
[QUOTE=kpjVideo;52677261]Find an API that can convert it, fetch it with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/http/Fetch]http.Fetch[/url] and use the success function to play the sound if it's URL is valid.[/QUOTE] I would need to useyoutubes api as if i used any other it is against youtubes tos and those "converter" sites change a lot.
[QUOTE=Martin132;52680064]I would need to useyoutubes api as if i used any other it is against youtubes tos and those "converter" sites change a lot.[/QUOTE] [URL="https://stackoverflow.com/questions/26548884/is-there-a-youtube-api-that-gives-only-audio/26552805#26552805"]YouTube doesn't have an API for audio only, it's against their TOS[/URL].
So there is no way of doing it without breaking youtube's tos?
[QUOTE=Martin132;52680117]So there is no way of doing it without breaking youtube's tos?[/QUOTE] The only other way is to play the video and hide it, which is much easier than using other APIs anyway
Well, I would need to try and make it so that all the players are hearing the music at the same time and also if a player joins they can also hear it at that time and play from there onward. Also, i have to use youtube's API anyway as I need to get the video data so it can be saved in a database :P
[url]http://www.youtubeinmp3.com/api/[/url]
[QUOTE=rtm516;52680169][url]http://www.youtubeinmp3.com/api/[/url][/QUOTE] As I said before it's against youtube's tos so I won't be able to use it
Create an awesomium control with YouTube on and use the time var in seconds to define the seek, put it outside the screen and it "works"
Use an invisible DHTML panel with an autoplaying YouTube video
[QUOTE=gonzalolog;52680474]Create an awesomium control with YouTube on and use the time var in seconds to define the seek, put it outside the screen and it "works"[/QUOTE] Don't really know what you mean Lol. I mean i was just going to use the youtube api get the length of the song and the time that the song started then make it load the song from that time :P but it might not work :/
You don't need the API at all if you already know when the song started and much it lasts, in case you want to build a music player, hunmm no...I don't recommend you it due how expensive for clients it is, also forget about spatial sound
[QUOTE=gonzalolog;52681207]You don't need the API at all if you already know when the song started and much it lasts, in case you want to build a music player, hunmm no...I don't recommend you it due how expensive for clients it is, also forget about spatial sound[/QUOTE] It has been requested to me meny of times and i have nothing else better to do so why not.
Whatever, we already told you it's not possible anyway without requiring to use mp3 sites
It is possible as playx and a lot of other addons have done it.
[QUOTE=Martin132;52680220]As I said before it's against youtube's tos so I won't be able to use it[/QUOTE]
Sorry, you need to Log In to post a reply to this thread.