After the update it seems that trying to use any sort of <object> or <embed> in a vgui.Create("HTML") is broken. I've read a few things about HTML being rendered in a new window outside of gmod but in my case it just does nothing at all. Anyone know of a fix for using a windows media player embed in derma?
Not even the example code off the wiki works :/
[lua]
function RunTest(ply, cmd, arg)
Winmain = vgui.Create("DFrame")
Winmain:SetPos(0,0)
Winmain:SetSize(800,600)
Winmain:SetVisible(true)
Winmain:SetTitle( "StartAnimate() Test" )
Winmain:MakePopup()
Winmain:ShowCloseButton(true)
Winhtml = vgui.Create( "HTML" , Winmain)
Winhtml:SetPos(0,30)
Winhtml:SetSize(790,560)
Winhtml:SetVisible(true)
local link = "dagobah.biz/copy1_dagobah_biz/Touhou_Canyon.swf" // you can put whatever media you want here
local url = [[<center>
<OBJECT ID="MediaPlayer" WIDTH="750" HEIGHT="530" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="http://]]..link..[[">
<PARAM name="autostart" VALUE="true">
<PARAM name="ShowControls" VALUE="false">
<param name="ShowStatusBar" value="false">
<PARAM name="ShowDisplay" VALUE="false">
</OBJECT>
</center>]]
Winhtml:SetHTML( url )
Winhtml:Refresh(true)
Winhtml:StartAnimate(100)
end
concommand.Add("animtest", RunTest)
[/lua]
Oh yeah, I had this problem too, that's why I was trying to play music straight off of youtube instead of embedding the mp3s directly.
Seeing how the new HTML panel uses webkit, of course Windows Media Player will not work with it.
With the help of playx, I was able to use a flash object.
[lua]self.HTMLPanel.OpenURL2 = function( panel, url )
local flashVars = {
["autostart"] = "true",
["backcolor"] = "000000",
["frontcolor"] = "444444",
["start"] = 0,
["volume"] = RADIO.Volume:GetInt(),
["file"] = url,
["playerready"] = "jwInit",
}
local result = GenerateFlashPlayer( 10, 10, RADIO.URL .. "player.swf", flashVars, nil, true )
panel:SetHTML( result:GetHTML() )
end[/lua]
There are 2 different types of plugins, windowed and "windowless". Windowed plugins have their own system level window, windowless plugins draw directly onto the web page via the browser APIs.
Flash can draw windowed or windowless, a plugin like WMP only draws windowed. The solution is to only use windowless plugins, or not use them at all.
Also, since the new panel uses WebKit it's probably a bad idea to use IE specific mark-up, if the wiki lists it then it should be updated.
I would use windowless flash to play mp3s but Garry has disabled the ability to interact with any flash. Altho I haven't tried so on the new WebKit API.
Edit:
Well it appears that the new WebKit API allows us to interact with flash again :eng101: so for the sake of the OSX users that will soon be playing gmod I guess moving from WMP to a flash based player would be better :/
[code]<embed src="http://www.google.com/reader/ui/3523697345-audio-player.swf" flashvars="audioUrl=http://www.example.com/song.mp3" width="400" height="27" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>[/code]
Sorry, you need to Log In to post a reply to this thread.