A radio stream through html and edit volume with javascript? Possible?
0 replies, posted
[CODE]local bool = true
local function Radio(ply, msg)
emsg = string.lower(msg)
if (emsg == "!radio") then
LocalPlayer().Panel = LocalPlayer().Panel or NULL
local Derp = LocalPlayer().Panel
if !bool then
if Derp:IsValid() then
Derp:Remove()
end
bool = true
chat.AddText("Radio Off")
else
chat.AddText("Radio On")
new_panel = vgui.Create("HTML")
new_panel:OpenURL("http://ng.net84.net/radio/Radio_ingame.html")
new_panel:SetVisible(false)
LocalPlayer().Panel = new_panel
bool = false
end
return true
end
end
hook.Add("OnPlayerChat","Radio",Radio)[/CODE]
First of all my javascript knowledge is at a nil atm (i'm reading up on it). I know javascript can find html elements and change values. So how would i go on about creating a "!volume amount" command that changes the volume of the stream i provided in OpenURL? Feel free to look at the source and please give me some pointers on where i should get started. All the confusing javascript is provided in the OpenURL bit of my script.
Sorry, you need to Log In to post a reply to this thread.