ThatRozebudDude / FPS-Plus-Public

Other
122 stars 110 forks source link

HxCodec Video Migration #90

Closed KirbyKid256 closed 3 months ago

KirbyKid256 commented 3 months ago

Replaces the Windows specific VLC code with the HxCodec library used in base game, but also adapting it to VideoHandler.hx instead of simply using HxCodec's FlxVideoSprite class. HxCodec has support for Windows, Linux, MacOS (what I use), and Android. The only issue I've encountered is that sometimes the video doesn't draw to the game, and I honestly don't know why.

doggogit commented 3 months ago

This is good and all, but I've asked this before in issue #61 and Rozebud said he doesn't have any plans to migrate yet

KirbyKid256 commented 3 months ago

Oh, well that would be fine if this was targeted for Windows only but if it isn't or you'll let people compile for other OSs, then I do need this because this engine won't compile for me otherwise since I can't use Windows, I can only use my MacOS.

ThatRozebudDude commented 3 months ago

I'll take a look at this. I probably should update the video stuff, I just haven't because it's given me trouble in the past when I was trying to implement it. If this works fine for me and I don't find any issues with it I'll probably merge it.

KirbyKid256 commented 3 months ago

Fair enough, I was struggling with this too and the only issue I had is sometimes the video doesn't draw. I don't know why, maybe it needs to be pre-cached or something. Right now I'm actually trying to see if there's any noticeable fixes with HxVLC like when the video finishes, it freezes for a split second such as with the TitleState.hx. It takes a while to recompile...

ThatRozebudDude commented 3 months ago

So, the way you implemented it, the VideoHandler isn't actually having the video drawn to it, it's just playing the FlxVideo on top of everything. The point of VideoHandler is that it has the video drawn to it and then you can move it around like a normal FlxSprite.

KirbyKid256 commented 3 months ago

That might actually explain the bug where sometimes the video doesn't draw, because it never drawed to the sprite for some reason. I could just replace the instances where VideoHandler is used with hxCodec's FlxVideoSprite which I know should work as I've used it before, and tested it by putting it in the stage itself. TBH the only reason I tried editing the VideoHandler instead was in case you planned on having web support. I'll see if I can try fixing it with the handler but if not and you don't intend to do web builds I'm just gonna use the FlxVideoSprite class

KirbyKid256 commented 3 months ago

Alright should be good to go now

ThatRozebudDude commented 3 months ago

Also, just for future reference, you probably shouldn't include stuff in the pr that isn't specifically related to what you're trying to change like the icon thing and the no trace thing in Project.xml.

KirbyKid256 commented 3 months ago

Also, just for future reference, you probably shouldn't include stuff in the pr that isn't specifically related to what you're trying to change like the icon thing and the no trace thing in Project.xml.

Alright, sorry I do have a tendency to do that.