Your Ad Here

Subscribe
 Post #1
 26th December 2009 Last edited by sk89q; 21st April 2010 at 07:24PM..
sk89q's Avatar
December 2009
305 Posts
___

NEW VERSION:
http://www.facepunch.com/showthread.php?t=927313

___

PlayX is a in-game media player that can play YouTube videos, Livestream channels, Flash movies, MP3, FLV, MP4, and AAC files, images, and Vimeo videos. Users who join your server after a video has started will be able to see video, right from the point where the video is for everyone else.

Features:
  • YouTube videos, Livestream channels, Flash movies, MP3, FLV, MP4, and AAC files, images, and Vimeo videos can be played
    • Select a particular provider, or let PlayX automatically detect that information from the URL
    • PlayX can be extended to play videos from other providers
    • YouTube videos can be played in a custom player that contains no pesky advertisements, and also likewise, no annotations and captions
      • The custom media player can be disabled on a case-by-case basis
    • Certain types of media (music files and images) are automatically put into a low frame rate mode that tells clients to render the video at 1 FPS, to prevent unnecessary reduce frame rate drop
      • Any piece of media can be forced into low frame rate mode
    • Flash movies will be "forced play" so that they can be played in the player even if you would normally have to press a "Play" button
  • The screen can be drawn on a prop or projected from a projector model
    • Available non-projector props are Counter-Strike: Source screens, and one projector is from CS:S
    • Another projector is the Gmod camera model, so anyone can watch the video with no needed addons or games
    • Any model can be used for the player even if the screen coordinates are not explicitly defined, although support varies, and it best works on (some) PHX plate models
    • The projector screen is the same size as the projector screens in IamMcLovin's YouTube player, allowing for easy replacement of the projector in an adv. dupe file
  • Videos can be resumed (support varies between providers)
    • Users can hide the player (where resume is supported), and restart the player, resuming the video from where it 'would be' for everyone else
    • Users who join after the video start can see the video from the point where it would be for everyone else
    • Videos can be started at a certain point in the video other than the beginning
    • Should the server clear of administrators, the player will automatically stop the video after a delay to prevent the video from continuing to load for everyone that joins
  • The currently playing media can be ended prematurely
    • The video can be automatically stopped when it ends if it is a YouTube video
      • Configurable grace period after the video ends so that users who may have had short buffering issues can still enjoy the video until the end
      • This feature can be disabled completely, or disabled on a video-by-video basis
  • Clients can adjust the frame rate of the screen as well as the volume of the video (support varies between providers)
    • The player can be disabled altogether by a client, and the setting will persist between sessions
      • If the player is disabled, the user will see a message on the screen reminding the user on how to re-enable the player
      • When a video is started, and the user has the player disabled, a notice will be printed to their chat reminding them that they have the player disabled
  • Protection against Gmod freezes (where you hear a click and water sound upon returning to Gmod) that will keep the video continuing to play
    • If the projector screen starts to appear only if the projector prop is in view, a button on the PlayX settings tool menu panel will correct that issue
  • PlayX is extensible
    • More providers can be added to PlayX
    • PlayX contains both client-side and server-side APIs
    • By default, PlayX checks whether you are an administrator on the server before giving access, but this can be overrided with a custom authorization routine

Screenshots:



Here is a video, created by GetOutOfBox:
http://www.youtube.com/watch?v=qYx9IxaQVv0

Download:



This is the easy install version of PlayX. Just drop the PlayX folder in the ZIP file into your addons folder. The YouTube/Media Query extension is also automatically installed, allowing you to search YouTube right from chat!

You can find the easy install version of PlayX but without the Media Query extension at:
http://cloud.github.com/downloads/sk....org-no-mq.zip

How to Use:
Developers:

There is a well-documented API and an authorization override callback.

PlayX is released under the GPLv2, and you can find the source code at:
http://wiki.github.com/sk89q/playx

Thanks to IamMcLovin for the idea (with his YouTube player) and for answering a question I had.

Future Versions:

Development has ceased (and so has most of my Gmod playing), but PlayX is open source, so anyone is free to continue with the project. The version that was in development had quite a few substantial additions that are not currently found in the officially released stable version, so you have a "head start."

For more information, please see:
http://www.facepunch.com/showpost.ph...&postcount=149
 Post #2
 26th December 2009
aualin's Avatar
April 2007
411 Posts
Very interesting, need to check it out
 Post #3
 26th December 2009
Gold Member
CapsAdmin's Avatar
August 2005
6,549 Posts
This sounds promising. :)

Edited:

hm, it just shows the screen with a red cross in the corner for me.

Code:
PlayX: Beginning media http://www.youtube.com/watch?v=GGP4BHR-iBY with handler JW, start at 0s
PlayX DEBUG: Begin media message received
PlayX: Playing http://www.youtube.com/watch?v=GGP4BHR-iBY using handler JW
 Post #4
 26th December 2009
Medevilae's Avatar
December 2008
85 Posts
Wow. Nice.

Is the sound it emits local, or does everyone hear it?
 Post #5
 27th December 2009
sk89q's Avatar
December 2009
305 Posts
This sounds promising. :)

Edited:

hm, it just shows the screen with a red cross in the corner for me.

Code:
PlayX: Beginning media http://www.youtube.com/watch?v=GGP4BHR-iBY with handler JW, start at 0s
PlayX DEBUG: Begin media message received
PlayX: Playing http://www.youtube.com/watch?v=GGP4BHR-iBY using handler JW
Post a screenshot if you can.

Also, try unchecking the "Use JW player when applicable" checkbox to see if changes anything.

Then tell me your operating system and Internet Explorer version.

Wow. Nice.

Is the sound it emits local, or does everyone hear it?
Everyone hears it. It still depends on ol ' Internet Explorer and the HTML control to play videos.
 Post #6
 27th December 2009 Last edited by CapsAdmin; 27th December 2009 at 12:34AM..
Gold Member
CapsAdmin's Avatar
August 2005
6,549 Posts
Oh. For some reason internet explorer doesn't have flash or something on my computer. Fixed it by installing it.

My bad.
 Post #7
 27th December 2009
iRzilla's Avatar
August 2008
1,854 Posts
Add a feature if chrome exists it'll use that.
 Post #8
 27th December 2009
sk89q's Avatar
December 2009
305 Posts
That's on my maybe-to-do list. I played with gm_chrome today, though I couldn't get it working. I'll look into it at another time.
 Post #9
 27th December 2009
Dennab
October 2008
3,947 Posts
This looks exceptional so far.
 Post #10
 27th December 2009
aualin's Avatar
April 2007
411 Posts
I have to applaud the decision to license it under GPL.
Looks amazing, especially the project/camera!
 Post #11
 27th December 2009
Dennab
October 2008
3,947 Posts
How do you install this? It's confusing.
 Post #12
 27th December 2009
aualin's Avatar
April 2007
411 Posts
What? Put in addons???
 Post #13
 27th December 2009
Gold Member
CapsAdmin's Avatar
August 2005
6,549 Posts
There's a folder in src. Put that folder in your addons folder.
 Post #14
 29th December 2009
Helimaster's Avatar
July 2007
3 Posts
How does the camera work? :o
 Post #15
 30th December 2009
Wizard of Ass's Avatar
April 2009
598 Posts
I still prefer ingame chrome browser...

Even it requiers the awesomnium.dll and much more...
It doesn't drop the framerate as hell, it can play any video formats and you can really use for internet stuff.
 Post #16
 30th December 2009
sk89q's Avatar
December 2009
305 Posts
How does the camera work? :o
It just acts like a projector would. The screen gets put onto the plane of whatever the camera is facing.

I still prefer ingame chrome browser...

Even it requiers the awesomnium.dll and much more...
It doesn't drop the framerate as hell, it can play any video formats and you can really use for internet stuff.
Well, it's not a browser. It's a player that lets you share media with other people.

Personally, I don't bother. I play Gmod windowed, so I can just alt-tab out.
 Post #17
 30th December 2009
Wizard of Ass's Avatar
April 2009
598 Posts
It just acts like a projector would. The screen gets put onto the plane of whatever the camera is facing.



Well, it's not a browser. It's a player that lets you share media with other people.

Personally, I don't bother. I play Gmod windowed, so I can just alt-tab out.
Oh if you use the chrome browser with wire inputs everybody can see everything...
 Post #18
 30th December 2009
sk89q's Avatar
December 2009
305 Posts
Not if they don't have gm_chrome installed, which most people don't. I didn't even have it installed myself until the other day.
 Post #19
 30th December 2009
Gold Member
DiscoBiscut's Avatar
June 2008
2,227 Posts
I've been using this on my server, it's really cool.
 Post #20
 30th December 2009
Dennab
October 2009
122 Posts
Screw youtube player, this is the bomb! Time for a theater gamemode.
 Post #21
 30th December 2009
Dennab
October 2008
3,947 Posts
This is way better than youtube player!
 Post #22
 31st December 2009
Axelite's Avatar
December 2009
6 Posts
I dont get it. How do you download this?
 Post #23
 31st December 2009
Grocel's Avatar
October 2008
385 Posts
Oh if you use the chrome browser with wire inputs everybody can see everything...
I did one with wire inputs and outputs, but it's relay early and some of them (most outputs) are not working right yet. :)
 Post #24
 31st December 2009
Tayg0's Avatar
July 2007
899 Posts
Thank god, I've been waiting for a decent music player that can play any mp3 link!
Gj man, and thanks!
 Post #25
 31st December 2009 Last edited by sk89q; 31st December 2009 at 06:28AM..
sk89q's Avatar
December 2009
305 Posts
I dont get it. How do you download this?
Click the "download" button, and inside the ZIP fille, there will be a gmod-XXXXXXXX folder. Inside that folder will be a src folder. Then in that gmod-XXXXXXXX/src folder is a "PlayX" folder. You need to put that folder into your addons directory. I'll make a easier to understand download soon enough.

Wire I/O is something I plan for eventually. Input will be disabled by default though, but it will be toggleable with a cvar.

It is presently possible to start media via a console command, and thus E2, but the syntax of the command may change in the future, so I do not recommend using it.

One console command that I didn't mention much was playx_spawn <model> though. That lets you use any prop as the screen, although it doesn't work very well for most props sans the PHX plates. It's also not safe to rely on any non-PHX plate model, as I may change the screen placement algorithm in the future.
 Post #26
 31st December 2009
help911's Avatar
December 2009
1 Posts
This media player works great.Thanks.But i can't make it visible for other players on server.In description i see it avaiable but how to enable it?
 Post #27
 31st December 2009
Axelite's Avatar
December 2009
6 Posts
Ah, thanks.
Works great, but what i'm missing is a list of videos/tracks that you can save like with the youtube player.
 Post #28
 31st December 2009
Mamok Zalku's Avatar
August 2008
544 Posts
Overcomplicated Downloader find a new website for dumbies like me.
 Post #29
 31st December 2009
sk89q's Avatar
December 2009
305 Posts
Ah, thanks.
Works great, but what i'm missing is a list of videos/tracks that you can save like with the youtube player.
Oh so that's what that did. I was wondering about that.
 Post #30
 31st December 2009
Dennab
December 2009
67 Posts
You cant save things with the Youtube player. Ive been using gmod a long time and when i used youtube played there was no save videos in it.
 Post #31
 1st January 2010
jerard999's Avatar
January 2009
1 Posts
Really cool and useful, but is there a way to play video files that are stored on your computer, other than files on the net? If not, does anyone know of a way to play videos from your computer in game?
 Post #32
 1st January 2010 Last edited by sk89q; 1st January 2010 at 05:03AM..
sk89q's Avatar
December 2009
305 Posts
It won't play video files stored on your computer.

________

I uploaded the Media Query extension that we are using on Stramic.com build [72.51.60.83:27015] (a great sandbox server where I'm an administrator!) that allows you to control PlayX via chat commands, as well as search YouTube in-game.

Direct link to the Lua file, that can be put into lua/autorun/server:
http://github.com/sk89q/playx/blob/m...edia_query.lua
(Also available if you download the whole package.)

Commands:
  • !yt <query> - Search YouTube in-game for embeddable videos, and get the first result (it will not play, though)
  • !ytplay [query] - Search YouTube, and play it as well, but if you do not provide an argument/search query, then the last found video (via !yt or so) will be played
  • !ytlisten [query] - Works just like !ytplay, except it will put videos into low frame rate mode (for music-only videos)
  • !ytlast - Plays the last found video
  • !play <URI> - Plays a piece of media (provider is auto-detected)
  • !link <URI> - Alias of !play
  • !palyx <URI> - Alias of !play

In addition to that, you can also just paste a YouTube URL anywhere in your message and its title will be looked up and printed to chat:

(Then you can do !ytplay or !ytlisten)

Note that the search and lookup features can be used by anyone, but only administrators can use the PlayX player.

This kind of mitigates for the lack of favorites (which I consider adding), which is probably why I didn't think about adding favorites. The idea was inspired from an IRC bot I wrote a while ago, so events just fell into place.

Happy New Years!
 Post #33
 1st January 2010
Gold Member
kp3's Avatar
January 2008
3,613 Posts
Screw youtube player, this is the bomb! Time for a theater gamemode.
That would be extremely boring.
Here's a tip, Watch a movie outside of gmod, Even better, Watch it in a real theater.
 Post #34
 1st January 2010
Axelite's Avatar
December 2009
6 Posts
You cant save things with the Youtube player. Ive been using gmod a long time and when i used youtube played there was no save videos in it.
No, but you can save the links to videos.
 Post #35
 2nd January 2010
sk89q's Avatar
December 2009
305 Posts
Beta 3 is out, with some minor bug fixes.

http://github.com/sk89q/playx/downloads
 Post #36
 16th January 2010 Last edited by sk89q; 16th January 2010 at 02:54AM..
sk89q's Avatar
December 2009
305 Posts
I officially released 1.0. The upload I put on garrysmod.org is a no-brainer version of everything -- just drop the PlayX folder into your addons folder. The Media Query extension that allows you to search YouTube from chat is also included, so you no longer have to manually install it.

http://www.garrysmod.org/downloads/?a=view&id=88535

FYI, since the first public release, there has only been bug fixes. This version is no different from RC1, sans a version number change.

Edit: I noticed SGNinja101's YouTube vote addon. This version automatically includes Media Query, which will not conflict with the version for PlayX that SGNinja101 is making, but both Media Query and his addon will trigger on mention of a YouTube URL. Media Query will only print the title of the video, so at worst, it may create chat spam.
 Post #37
 16th January 2010
Kill coDer's Avatar
April 2006
874 Posts
How about creating a chrome version? Perhaps using gm_bass as well to stream the mp3 files?
 Post #38
 16th January 2010
sk89q's Avatar
December 2009
305 Posts
That's still in the to-consider-to-do list.

I've never used gm_bass before, but doesn't it require a DLL?
 Post #39
 16th January 2010
Kill coDer's Avatar
April 2006
874 Posts
gm_bass is the dll.

I'm in need for a media solution, so I'm creating one with chrome. It's not very difficult, just a replacement for the html vgui element, essentially.

Bass is slightly more complicated to use, there is no documentation, so I've had to work it out myself..
 Post #40
 16th January 2010 Last edited by sk89q; 16th January 2010 at 08:54AM..
sk89q's Avatar
December 2009
305 Posts
Well my intention is that everyone can view/play the media, so having requirements is out of the question.

You can play MP3 files with PlayX. Or by streaming MP3, do you mean streaming Shoutcast?

EDIT:

After figuring out how gm_chrome worked, getting PlayX to automatically use gm_chrome took only 10 minutes. And it works beautifully.

However, I still need to allow gm_chrome to be disabled, clean up the code a bit, and most importantly, battle an Adobe Flash Player warning.

You can find the changes in a new gm_chrome branch:
http://github.com/sk89q/playx/tree/gm_chrome
Diff: http://github.com/sk89q/playx/commit...f311005e172eab
Reply

All times are GMT. The time now is 06:32AM.

Facepunch Studios 2010 - Server 'MARGE'