• PlayURL Multiple links?
    3 replies, posted
Hello I was thinking about if its possible to do YouTube URLs for PlayURL. and if its possible, then how to do multiple YouTube URLs? If you got some ideas ,then you post some examples. Thanks !
try putting [url]http://www.youtubeinmp3.com/fetch/?video=[/url] before your YouTube URL EG: http//www.youtubeinmp3.com/fetch/?video=https://www.youtube.com/watch?v=i62Zjga8JOM [editline]2nd June 2016[/editline] If you want to stack the videos so after one stops the other one starts make a get request to [url]https://www.youtubeinmp3.com/fetch/?format=JSON&video=http://www.youtube.com/watch?v=i62Zjga8JOM[/url] but change the vid url and then use the returned data to play and start a timer for the end of the video. (downloadurl = playurl) [editline]2nd June 2016[/editline] Something like this (has no error checking) [LUA] local youtube_vids = {} youtube_vids[1] = "https://www.youtube.com/watch?v=OPf0YbXqDm0" youtube_vids[2] = "https://www.youtube.com/watch?v=d7ypnPjz81I" function OpenVid(id) if (type(youtube_vids[id]) == nil) then return end local vidInfo = {} http.Fetch("https://www.youtubeinmp3.com/fetch/?format=JSON&video="..youtube_vids[id], function(body, len, headers, code) vidInfo = util.JSONToTable(body) end, function(error) end) sound.PlayURL(vidInfo["link"], "3d", function(station) if (IsValid(station)) then station:SetPos(LocalPlayer():GetPos()) station:Play() else LocalPlayer():ChatPrint("Invalid URL!") end end) timer.Simple(tonumber(vidInfo["length"]), function() OpenVid(id+1) end) end [/LUA]
[LUA] local youtube_vids = {} youtube_vids[1] = "https://www.youtube.com/watch?v=OPf0YbXqDm0" youtube_vids[1] = "https://www.youtube.com/watch?v=d7ypnPjz81I" [/LUA] Pssst, you forgot to increment your index :s:
[QUOTE=guigui;50442616][LUA] local youtube_vids = {} youtube_vids[1] = "https://www.youtube.com/watch?v=OPf0YbXqDm0" youtube_vids[1] = "https://www.youtube.com/watch?v=d7ypnPjz81I" [/LUA] Pssst, you forgot to increment your index :s:[/QUOTE] Oh yea will fix that now, was like 1:00 am when i made it :)
Sorry, you need to Log In to post a reply to this thread.