• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

Asset - Extension Video Player (for Windows, macOS, and Ubuntu)

Samuel Venable

Time Killer



Supports 32-bit Windows, macOS, and 32-bit GMS 1.4 / 64-bit GMS 2 Ubuntu.

For 64-bit Windows support and to support development, see Video Player Pro.

Pros: Free. Open Source. Permissive MIT License. Cross-Platform for Desktop.

Cons: Can not Render to a Texture. Fills Game Window only. No Drawing over.

Add me on Discord to get faster support than email: Samuel Venable#5465

Special thanks to YellowAfterlife for the asset icon!

Download Free for GameMaker Studio 2.2, 2.3 (Marketplace)
Download Free for GameMaker Studio 1.4, 2.2, 2.3 (itch.io)


Functions included:
C++:
// GameMaker 8.1 splashvideo functions
void splash_set_stop_mouse(bool stop);
void splash_set_stop_key(bool stop);
void splash_show_video(std::string fname, bool loop);

// GM extension video playback functions
void splash_set_window(std::string wid);
void splash_set_volume(int vol);
std::string video_add(std::string fname);
bool video_get_option_was_set(std::string ind, std::string option);
std::string video_get_option_string(std::string ind, std::string option);
void video_set_option_string(std::string ind, std::string option, std::string value);
void video_play(std::string ind);
bool video_is_paused(std::string ind);
bool video_is_playing(std::string ind);
int video_get_volume_percent(std::string ind);
void video_set_volume_percent(std::string ind, int volume);
std::string video_get_window_identifier(std::string ind);
void video_set_window_identifier(std::string ind, std::string wid);
void video_pause(std::string ind);
void video_stop(std::string ind);
unsigned video_get_width(std::string ind);
unsigned video_get_height(std::string ind);
double video_get_position(std::string ind);
double video_get_duration(std::string ind);
bool video_exists(std::string ind);
void video_delete(std::string ind);
std::string window_identifier();
Have fun boys,
Samuel
 
Last edited:

chamaeleon

Member
This bypasses the GPL license of mpv media player because I am posting to the command line program's website which gives the source and I am not linking to any library statically nor dynamically with this extension, I am running the application from the command line, which means you don't have to share the source of your games because due to not linking to anything you're off the hook with the GPL, so congrats.
My understanding of GPL is if you distribute a compiled program you are also responsible for ensuring access to the GPL source either by including it or including documentation that states how to access it, and the access must be provided by you, and not depend on the original authors and their means of distributing it. This includes your distribution, as well as anyone distributing a game based on your extension.
 

Samuel Venable

Time Killer
My understanding of GPL is if you distribute a compiled program you are also responsible for ensuring access to the GPL source either by including it or including documentation that states how to access it, and the access must be provided by you, and not depend on the original authors and their means of distributing it. This includes your distribution, as well as anyone distributing a game based on your extension.
That is incorrect, you need to be actually linking to the code for your game to be affected by this at all. I'm going to ask the person I got this information to give a better and more direct explanation. If I am able to prove what I said is true, I'm going to request a moderator to remove your post for spreading false infomation.

You have good intentions, but I don't want people to be too scared to download my extension if you happen to be misinformed. I could very well be myself, so that's why I'm clarifying with someone who is well versed in these kind of legal matters for clarification.

I hope I didn't come across rude, I was just excited about this extension release and it looks like based on what you said crap already hit the fan, lol

I hope this gets sorted out and I hear back from them soon. I didn't think this was an issue.
 
Last edited:

chamaeleon

Member
That is incorrect, you need to be actually linking to the code for your game to be affected by this at all. I'm going to ask the person I got this information to give a better and more direct explanation. If I am able to prove what I said is true, I'm going to request a moderator to remove your post for spreading false infomation.

You have good intentions, but I don't want people to be too scared to download my extension if you happen to be misinformed. I could very well be myself, so that's why I'm clarifying with someone who is well versed in these kind of legal matters for clarification.

I hope I didn't come across rude, I was just excited about this extension release and it looks like based on what you said crap already hit the fan, lol
You are distributing a linked executable, mpv.exe. This is the executable whose code you or users of your extension need to distribute, not the code for whatever game uses it. I should have been more clear about that.
 

Samuel Venable

Time Killer
You are distributing a linked executable, mpv.exe. This is the executable whose code you or users of your extension need to distribute, not the code for whatever game uses it.
Ah, few, ok good. Thank you so much for the clarification! :D I'm quick to hit the panic button. So if that is the case, i assume i need to make it available with the asset itself? I can just put it in a zip under included files, and then I'm ok?

If that is sufficient I'm going to publish the update ASAP. Thank you so much for keeping me out of trouble! lol
 

chamaeleon

Member
Ah, few, ok good. Thank you so much for the clarification! :D I'm quick to hit the panic button. So if that is the case, i assume i need to make it available with the asset itself? I can just put it in a zip under included files, and then I'm ok?
That is my understanding, yes, it would satisfy the GPL to the letter, and users of your extension would be covered if they did the exact same thing with it.

Edit: IANAL ... :)
 

Samuel Venable

Time Killer
Yay, ok, so I updated the asset and its description:

When exporting your game please do not delete mpv-master.zip from your game distribution to comply with GPL. This also goes for when distributing the source of your game if you want your game source to be accessible to your development team or whoever, you are not authorized to delete the source of mpv media player found in the mpv-master.zip file when distributing the binary mpv.exe and mpv.com files. On Linux this isn't an issue because when you install mpv from your package manager the source code should be downloaded with it if the package manager is to comply with GPL, which it probably does.
 

FoxyOfJungle

Kazan Games
This is very cool! (like everything you do) Do you have a reason that this runs slowly in fullscreen? I think I could use this on a Launcher that I'm doing, but the fact that it is fullscreen and playing the video slowly can get in the way. Thank you for making it free. :)
 

Samuel Venable

Time Killer
This is very cool! (like everything you do) Do you have a reason that this runs slowly in fullscreen? I think I could use this on a Launcher that I'm doing, but the fact that it is fullscreen and playing the video slowly can get in the way. Thank you for making it free. :)
I'm in the process of replacing the version of the extension that runs on Windows to use the DirectShow API instead of mpv media player which should help fix that. Or is this happening on Linux?
 

FoxyOfJungle

Kazan Games
I'm in the process of replacing the version of the extension that runs on Windows to use the DirectShow API instead of mpv media player which should help fix that. Or is this happening on Linux?
It is a good idea, especially if you do not necessarily need to depend on a third party license, having to keep a copy of "unnecessary" files. I don't have Linux, only Windows by the way. I don't remember how Game Maker 8 used to play videos, but it still works amazingly today 🤔, his only weakness is that he is very limited because he doesn't have controls or can't draw anything over the top. (GM 8)
 

Samuel Venable

Time Killer
It is a good idea, especially if you do not necessarily need to depend on a third party license, having to keep a copy of "unnecessary" files. I don't have Linux, only Windows by the way. I don't remember how Game Maker 8 used to play videos, but it still works amazingly today 🤔, his only weakness is that he is very limited because he doesn't have controls or can't draw anything over the top. (GM 8)
GameMaker 8.1 used DirectShow - the same thing this extension uses, as of right now. :D

GMS2 - Version 1.2.1. Published August 13, 2020
  • No longer uses mpv media player on Windows. Still does on Linux.
 

Samuel Venable

Time Killer
well done, great job.
Also thank you for video player source code too.
very handy.
You're welcome!

The next update will include error printing when run from command prompt on Windows to show the exact line and function in the source that failed and the error description to help users debug the problem if their video doesn't play. This might be added on Linux as well as I'm very certain mpv media player already does this or something similar on its own, so it would just be a matter of capturing the output from the mpv executable and redirecting that to print in the terminal from the parent process.
 

Samuel Venable

Time Killer
That's a nice feature to have, I can't wait to test it.
keep up the good work.
The update has been published. It is only added to Windows at the moment. I figured it would be better to have it show graphical errors instead of silent printing so it you won't be required to run from the terminal when something has gone wrong to find out why. Also video_stop() and video_delete() now work properly so you are able to call them in any event, not just game end. Which means you can now skip videos properly.

Edit:

I spoke too soon. While video_stop() works fine, video_delete() is still having issues. In most cases, you shouldn't really need to use video_delete() anyway, so it's not a huge problem. I can't think of a time where it's truly necessary to use that function, to be honest. It's a Windows-only issue.

Edit2:

Ok, I just publish 1.7.0 which I'm certain has fixed the video_delete() segfault problem on Windows.

Edit3:

Just published 1.8.1 and this is the most rock-solid stable it has been thus far on Windows. There aren't any more bugs I can find currently, I'm pretty sure I fixed all that was left. If I happen to be wrong and anyone finds a bug of some kind they'd like to file a report for or would like to contribute, both may be done on GitHub over at the official repository for the extension: https://github.com/time-killer-games/libvidplayer
 
Last edited:
Great job dude, I will try it and see how it goes. Also, it would be perfect to have a direct notifications, logs and messages for debugging and feedback inside Gamemaker. it should not be so hard to add this kind of logs, I already did that in the android video player and it was pretty easy.
in java it's like :
Java:
int dsMapIndex = RunnerJNILib.jCreateDsMap(null, null, null);
RunnerJNILib.DsMapAddString(dsMapIndex, "type", "video_completed");
RunnerJNILib.CreateAsynEventWithDSMap(dsMapIndex, EVENT_OTHER_SOCIAL);
Log.i("yoyo","Video_onVideoCompleted ");
 

Samuel Venable

Time Killer
Great job dude, I will try it and see how it goes. Also, it would be perfect to have a direct notifications, logs and messages for debugging and feedback inside Gamemaker. it should not be so hard to add this kind of logs, I already did that in the android video player and it was pretty easy.
in java it's like :
Java:
int dsMapIndex = RunnerJNILib.jCreateDsMap(null, null, null);
RunnerJNILib.DsMapAddString(dsMapIndex, "type", "video_completed");
RunnerJNILib.CreateAsynEventWithDSMap(dsMapIndex, EVENT_OTHER_SOCIAL);
Log.i("yoyo","Video_onVideoCompleted ");
Sure, I'll have a look at it and see what I can do.

It's worth mentioning, since you have been working on a video player as well, you are free to create your own version of my extension and adapt it to match your extension's exact API, and closed-source / sell it if you like, since I intentionally licensed the extension permissively.
 
Thanks, dude, I can send you my video player extension if you are interested in.
It's a video player that can play ads after finish the video (optionally).
of course, it's in java and objective C and works for android and ios.
 
Last edited:

Samuel Venable

Time Killer
I don't develop mobile extensions, while I do know Objective C thanks to Mac, mainly because I don't have an iOS device I can't do that one, and in the case of Android I'm not a fan of Java.

Thanks for the kind offer though.

Edit:

The extension has been ported to GameMaker 8.1. Download link in the OP.

Edit2:

Ok, so on Linux the video player steals window focus so the game window can only receive keyboard input when you click the title bar or border to give the parent window focus I can't seem to find a way around that. You can't skip the video from keyboard input unless the parent window has focus by clicking the window border or title bar. Normally you could cheat your way around this by using keyboard_check_direct() but that seems to not work on Linux for this purpose. The parent window still needs focus, rending keyboard_check_direct() useless. Might be a GM bug.

So I was wondering to make it seamlessly cross-platform should I adopt this behavior on Windows? I can just do that by removing the child window style from the video, then it will behave exactly the same as it does on Linux, except the parent window will have its border and title bar grayed out from the lack of focus, and I'm not sure why Windows does this but Linux doesn't. I thought they both did that Windows behavior.
 
Last edited:

Samuel Venable

Time Killer
Switched to using libmpv instead of DirectShow on Windows. No longer uses command line mpv on Linux and FreeBSD. Mac support will be added soon. Now supports all video formats supported by ffmpeg on all supported platforms. mpv media player (the command line version) is GPL however libmpv (the client library) is LGPL and 1) I have not modified the binary's original source code and 2) I'm not statically linking it, so there are not as many restrictions now as there were with the command line program version. Please let me know if I am wrong.
 
Last edited:

Josepho

Member
You are awesome! there wasnt any functional mac video support at the moment, or at least i wasnt able to find it

I tried to download the extension from your link and it says the link is broken :(
 
Last edited:

Josepho

Member
Thanks, dude, I can send you my video player extension if you are interested in.
It's a video player that can play ads after finish the video (optionally).
of course, it's in java and objective C and works for android and ios.
Do you have the extension for sale?
 

Samuel Venable

Time Killer
You are awesome! there wasnt any functional mac video support at the moment, or at least i wasnt able to find it

I tried to download the extension from your link and it says the link is broken :(
I was updating the links around the time you must've tried it, I'd try it again. I'm not paying apple to codesign my stuff because everything I do is free and open source. Please add me on discord if you run into trouble. Right now I'm relying on installing files via homebrew but since homebrew doesn't install anything codesigned it might not work for people who do codesign so I'll need a tester to verify how this works.

If that doesn't end up working out I have a backup plan to fallback on that doesnt involve using homebrew but requires me hosting my extension not on the marketplace anymore because the file size will be too big again. :/
 

Josepho

Member
I was updating the links around the time you must've tried it, I'd try it again. I'm not paying apple to codesign my stuff because everything I do is free and open source. Please add me on discord if you run into trouble. Right now I'm relying on installing files via homebrew but since homebrew doesn't install anything codesigned it might not work for people who do codesign so I'll need a tester to verify how this works.

If that doesn't end up working out I have a backup plan to fallback on that doesnt involve using homebrew but requires me hosting my extension not on the marketplace anymore because the file size will be too big again. :/
At this point i cant find the link lol, i guess you removed it. I already sent you an invitation to your discord if you need a mac tester i can help :)
 

Samuel Venable

Time Killer
I can't make use of this info for this particular asset because of the upload file size limit, but for everyone else who would like to know early on:

BTW - If you have the 64bit DLL sitting beside the 32bit one and call it (assuming 32 bit one is called <name>.dll) <name>_x64.dll then the Runner should find the 64bit one after the 32bit one fails to load.

I have not checked the manual but I did provide the info to Mark so it should be in the manual for 2.3.1

Russell
@Sybok @YellowAfterlife @zbox and please whoever else I missed who makes extesions that could be tagged here
 
Last edited:

Samuel Venable

Time Killer
Just wanted to point out to everyone the video_* functions unlike the splash_* are asynchronous and can play audio as well not just video files, and much like the video files it supports pretty much any audio format you can think of thanks to mostly ffmpeg and it even can load and play midi files surprisingly even though ffmpeg which libmpv is based on can't play those libmpv took the extra mile to add support for midis and best of all this is cross-platform as well.
 
Top