Raised This Month: $12 Target: $400
 3% 

[Request] Open URL in Hidden MOTD, with options


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 08-11-2014 , 02:10   [Request] Open URL in Hidden MOTD, with options
Reply With Quote #1

I propose / request a plug-in that will open URL's in a "hidden" MOTD window - but with various other options/controls - mostly for the purpose of playing music from streaming auto/video sites (like YouTube) - instead downloading MP3's from game-servers.

Basic concept and limitations:

The basic concept and features for this plug-in would be:
  • Open URL's in a "hidden" MOTD page - to allow only their audio to be heard.
  • Implement commands to make opening the URL "optional" or "mandatory".
  • "Optional" opens the URL (and consequently initiates audio play-back) - but checks a client preference first.
  • "Mandatory" opens the URL (and consequently initiates audio play-back) - ignoring any client preference.
  • Opening the URL (initiating play-back) is "targetable" (@me, @humans, @red, @blue, etc.).
  • Each player's default status ("opted-in" or "opted-out") is configurable with a server-side CVAR.
  • Regardless of "optional" or "mandatory" command, allow user to stop play-back (mid-play).
  • Which audio or video URL to open is specified by full URL string (to allow for customization of YouTube URL options, and possibly alternative streaming sites).
  • Since audio is streamed directly from YouTube and/or other site to the clients, there is no need to host music-related MP3 files on servers, and consequently no need to download those MP3 files to client computers!
Of course, some known limitations of this plug-in would be:
  • Only works for client's that have HTML-based MOTD's enabled.
  • Some tracks may not work from certain countries - based on YouTube's limitations.
  • YouTube may not work at all from certain countries - due to government efforts (China?).
  • There is a possibility of ads playing - but I think that can be worked-around by using some special options in the YouTube URLs.

Proof-of-concept work sofar:
I have done some proof-of-concept work using CLFY's "Hidden MOTD URL opener" plug-in. Basically, here is what I discovered (using that plug-in on my server).

Playing music from a YouTube video:
I can play any YouTube video in my client in a "hidden" MOTD window, like this:
Code:
sm_hiddenurl @me "https://www.youtube.com/watch?v=BdHgqPG_8mo"
Further, appending a "t=" parameter to the URL, I can make the video start to play at a particular time - which is useful for songs that have long lead-in's or other content at the beginning that it may be desirable to skip. In this example, play-back begins at 1-minute and 5-seconds from the beginning of the video:
Code:
sm_hiddenurl @me "https://www.youtube.com/watch?v=BdHgqPG_8mo#t=90"
YouTube seems to allow for the time parameters to be specified in seconds (the default if entered just as numerals), or in "XmXs" format (e.g. 90 seconds could be specified as "1m30s").

Stopping YouTube play-back:
I also discovered, that forcing that "hidden" MOTD window to re-open with any other page (even a blank page) causes the YouTube video play-back to stop. The cleanest way is to give the blank-page URI to open, like this:
Code:
sm_hiddenurl @me "about:blank"
Opt-IN / Opt-OUT stuff:
Some time back, moriss created a plug-in similar to sm_play, but with "opt-out" - which has some of the basic "opt-in / opt-out" functionality.

It should have two similar commands, one that is "mandatory" and one that is "optional". This would allow for certain important play-back (policy announcements, etc.) to be "mandatory", while other play-back (like music) could be "optional".

It should also have a server-side CVAR that dictates if the default for new players is "opted-IN" or "opted-OUT" of stuff played with the "optional" version of the command.

Obviously, there should be some sort of "stop" command - which would be ok to work regardless of whether the play command issued was the "optional" or "mandatory" version.

Proposed commands / syntax:
  • sm_hiddenurlopt target "URL"
  • sm_hiddenurlman target "URL"
  • sm_hiddenurlstop [target]

Examples:
  • Play YouTube video ID "BdHgqPG_8mo" on all human players (optionally):
    Code:
    sm_hiddenurlopt @humans "https://www.youtube.com/watch?v=BdHgqPG_8mo"
  • Play YouTube video ID "BdHgqPG_8mo" on all human players (mandatory):
    Code:
    sm_hiddenurlman @humans "https://www.youtube.com/watch?v=BdHgqPG_8mo"
  • Stop play-back on all humans:
    Code:
    sm_hiddenurlstop @humans
  • Stop play-back on self (equivalent to "@me"):
    Code:
    sm_hiddenurlstop
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter

Last edited by Weasel; 08-11-2014 at 02:34. Reason: Gammer, speling., updated title
Weasel is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 08-11-2014 , 02:28   Re: [Request] In-MOTD streaming audio play-back (Yes, it IS possible!)
Reply With Quote #2

PS: For anybody already familiar with CLFY's "Hidden MOTD URL opener" plug-in ... to cut to the chase, this is basically about adding the various "optional / mandatory" functionality mentioned and a dedicated/hard-coded "stop" URL. That will make it more friendly to be used for streaming music and such (i.e. by giving players the option to opt-out of listening to it, etc.).
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter

Last edited by Weasel; 08-11-2014 at 02:29. Reason: splling, gemmar
Weasel is offline
twerkin
Junior Member
Join Date: Nov 2013
Old 08-19-2014 , 05:58   Re: [Request] Open URL in Hidden MOTD, with options
Reply With Quote #3

I was using CLFY hidden motd plugin to play music and EVERYONE kept complaining about lag.
twerkin is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 08-24-2014 , 10:38   Re: [Request] Open URL in Hidden MOTD, with options
Reply With Quote #4

Quote:
Originally Posted by twerkin View Post
I was using CLFY hidden motd plugin to play music and EVERYONE kept complaining about lag.
The lags has nothing to do with the plugin, only how you send music.
__________________
zipcore is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 08-25-2014 , 00:20   Re: [Request] Open URL in Hidden MOTD, with options
Reply With Quote #5

On the one server I have where I am experimenting with this, I have not noticed any lag induced when sounds play. However, since it is all communication between the client and YouTube's servers (or whatever other streaming source is being used) - there is a variable delay between when the game-server tells the client to open the URL, and when the media actually begins to play - as the media is "buffering". That varies greatly from one client to another.
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter
Weasel is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode