ULX

Author Topic: Streaming Radio  (Read 5524 times)

0 Members and 1 Guest are viewing this topic.

Offline WillSWC

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Streaming Radio
« on: January 20, 2008, 08:07:40 PM »
I've been trying to get Embeded Radio working with ULX motd. Anyone have any thoughts? IFrame just destroyed GMod.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Streaming Radio
« Reply #1 on: January 21, 2008, 12:12:48 AM »
Source html interpreter is pretty finicky, as you're learning. I'm pretty sure it wasn't meant to be used for all the stuff Garry and other developers have pushed it to do.

You might try this link to see how the media player would have to be embedded in whatever page is loaded.
http://www.surfmusic.de/radio-station/knrj-energy-92-7-fm-dsl,5305.html
I'm not sure how it would work in latest html code/gmod offereings though, but it was the only method that could be used in Gmod9 days.
Probably not so different now.

Good luck
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline WillSWC

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Streaming Radio
« Reply #2 on: January 21, 2008, 12:14:30 PM »
Well i got it working quite nicely with that code if anyone else is intrested in it. Problem is you can't hide the MOTD to actually play while listening to the music without killing the player. Anyone have any ideas?

Code: [Select]
<OBJECT ID="MediaPlayer1" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab# Version=5,1,52,701" STANDBY="Loading Microsoft Windows® Media Player components..." TYPE="application/x-oleobject" width="280" height="46">
<param name="fileName" value="http://willswc.isa-geek.com:8005/;stream.nsv&">
<param name="animationatStart" value="true">
<param name="transparentatStart" value="true">
<param name="autoStart" value="false">
<param name="showControls" value="true">
<param name="Volume" value="-300">
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="http://willswc.isa-geek.com:8005/;stream.nsv&" name="MediaPlayer1" width=280 height=46 autostart=0 showcontrols=1 volume=-300>
</OBJECT>

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Streaming Radio
« Reply #3 on: January 21, 2008, 01:07:53 PM »
I think the old Gmod9 URadio used to just 'hide' the motd window. Kind of like minimizing it.
I suggest looking into Garry's HTML implimentation in his wiki.

Though a nice feature to revive, I've personally lost any interest in redoing it. I still have a project of my own I'd love to take off the back burner.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline WillSWC

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Streaming Radio
« Reply #4 on: January 21, 2008, 02:06:20 PM »
The trick is to figure out how to "hide" the motd. >.<

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Streaming Radio
« Reply #5 on: January 21, 2008, 02:50:42 PM »
panel:SetVisible( false )

 :D
Experiencing God's grace one day at a time.

Offline WillSWC

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Streaming Radio
« Reply #6 on: January 21, 2008, 03:41:51 PM »
I'm sure that's very important but any idea how i should apply that for a "Non"-Lua coder?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Streaming Radio
« Reply #7 on: January 21, 2008, 03:58:32 PM »
Instead of destroying the motd on exit, just hide it.
Experiencing God's grace one day at a time.

Offline WillSWC

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Streaming Radio
« Reply #8 on: January 21, 2008, 04:28:07 PM »
So basically I'd replace
Code: [Select]
button.DoClick = function() window:Close() endWith...? I tried replacing it with a few different commands but none of the actually worked. >.<

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Streaming Radio
« Reply #9 on: January 21, 2008, 05:36:23 PM »
Been a long time since I've looked at the motd code, but perhaps

button.DoClick = function() window:SetVisible( false ) end

Tried that?

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: Streaming Radio
« Reply #10 on: January 21, 2008, 07:51:21 PM »
You would have to make the "ulx motd" command call SetVisible( true ) after the first time rather than creating a new panel as well.
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

Offline WillSWC

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Streaming Radio
« Reply #11 on: January 21, 2008, 08:50:18 PM »
Code: [Select]
button.DoClick = function() window:SetVisible( false ) endThat worked Perfectly. Though, spbogie is obviousally correct that it needs to SetVisable True after the first time. Problem is being a novice lua coder I have absoutly no idea what I need to do for this. Any thoughts? (And once I'm done I'll make up a Tutorial for anyone else who needs help.)

Offline Avien

  • Full Member
  • ***
  • Posts: 168
  • Karma: 4
Re: Streaming Radio
« Reply #12 on: January 21, 2008, 09:46:04 PM »
Go to addons\ulx\lua\ulx\modules\cl\motdmenu.lua

Search for:
Code: [Select]
button.DoClick = function() window:Close() end
Replace with:
Code: [Select]
button.DoClick = function() window:SetVisible( false ) end
When the window opens it is already set to use SetVisible (true)

Offline WillSWC

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Streaming Radio
« Reply #13 on: January 26, 2008, 06:34:52 PM »
Ok, It an be closed. But how do you make a previously hidden window Viable again with the motd button?

Johnthebest

  • Guest
Re: Streaming Radio
« Reply #14 on: June 21, 2008, 08:26:39 AM »
Sorry for bringing up such a old topic, but it has to be completed for people like me who got 1 part of the problem solved, but not the other.

The MOTD solution works great, only how do I make a previously closed window visible again, because I/the rest of the server can't close the stream. Just creates another window when typing !motd, which will open the radio again with very anoying results.

I've looked into other solutions like the 1.fm mod or uRadio but it either didn't work or had to much bugs in it.

Can you guys help me out ;D