AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [Request] Open URL in Hidden MOTD, with options (https://forums.alliedmods.net/showthread.php?t=246053)

Weasel 08-11-2014 02:10

[Request] Open URL in Hidden MOTD, with options
 
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

Weasel 08-11-2014 02:28

Re: [Request] In-MOTD streaming audio play-back (Yes, it IS possible!)
 
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.).

twerkin 08-19-2014 05:58

Re: [Request] Open URL in Hidden MOTD, with options
 
I was using CLFY hidden motd plugin to play music and EVERYONE kept complaining about lag.

zipcore 08-24-2014 10:38

Re: [Request] Open URL in Hidden MOTD, with options
 
Quote:

Originally Posted by twerkin (Post 2186110)
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.

Weasel 08-25-2014 00:20

Re: [Request] Open URL in Hidden MOTD, with options
 
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.


All times are GMT -4. The time now is 01:35.

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