From 4ea1b65f57886147bf190a6a032251e7fdd01f7e Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Sat, 1 Jun 2024 12:40:00 +0000 Subject: [PATCH 01/16] Fixed polymod videos. --- .vscode/settings.json | 4 +-- Project.xml | 2 +- hmm.json | 8 ++--- source/funkin/graphics/video/FlxVideo.hx | 4 +-- source/funkin/play/cutscene/VideoCutscene.hx | 38 +++++++++++--------- source/funkin/ui/title/AttractState.hx | 22 +++++++----- tests/unit/project.xml | 2 +- tests/unit/test.hxml | 2 +- tests/unit/test.hxml-old | 4 +-- 9 files changed, 48 insertions(+), 38 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a8a67245b2..d47913d489 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -171,9 +171,9 @@ "args": ["-debug", "-DANIMDEBUG", "-DFORCE_DEBUG_VERSION"] }, { - "label": "Windows / Debug (Debug hxCodec)", + "label": "Windows / Debug (Debug hxvlc)", "target": "windows", - "args": ["-debug", "-DHXC_LIBVLC_LOGGING", "-DFORCE_DEBUG_VERSION"] + "args": ["-debug", "-DHXVLC_LOGGING", "-DHXVLC_VERBOSE=2", "-DFORCE_DEBUG_VERSION"] }, { "label": "HashLink / Debug (Straight to Animation Editor)", diff --git a/Project.xml b/Project.xml index 24cdac2700..ede49916d0 100644 --- a/Project.xml +++ b/Project.xml @@ -123,7 +123,7 @@ - + diff --git a/hmm.json b/hmm.json index 288aa80b8b..0e8c3cce8b 100644 --- a/hmm.json +++ b/hmm.json @@ -77,11 +77,9 @@ "version": "2.5.0" }, { - "name": "hxCodec", - "type": "git", - "dir": null, - "ref": "61b98a7a353b7f529a8fec84ed9afc919a2dffdd", - "url": "https://github.com/FunkinCrew/hxCodec" + "name": "hxvlc", + "type": "haxelib", + "version": "1.5.4" }, { "name": "hxcpp", diff --git a/source/funkin/graphics/video/FlxVideo.hx b/source/funkin/graphics/video/FlxVideo.hx index a0fab9c09b..15c5daea3f 100644 --- a/source/funkin/graphics/video/FlxVideo.hx +++ b/source/funkin/graphics/video/FlxVideo.hx @@ -12,8 +12,8 @@ import openfl.net.NetStream; /** * Plays a video via a NetStream. Only works on HTML5. - * This does NOT replace hxCodec, nor does hxCodec replace this. - * hxCodec only works on desktop and does not work on HTML5! + * This does NOT replace hxvlc, nor does hxvlc replace this. + * hxvlc only works on desktop and does not work on HTML5! */ class FlxVideo extends FunkinSprite { diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index 01a492a77a..19fefef28f 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -10,8 +10,8 @@ import flixel.util.FlxTimer; #if html5 import funkin.graphics.video.FlxVideo; #end -#if hxCodec -import hxcodec.flixel.FlxVideoSprite; +#if hxvlc +import hxvlc.flixel.FlxVideoSprite; #end /** @@ -25,7 +25,7 @@ class VideoCutscene #if html5 static var vid:FlxVideo; #end - #if hxCodec + #if hxvlc static var vid:FlxVideoSprite; #end @@ -93,7 +93,7 @@ class VideoCutscene #if html5 playVideoHTML5(rawFilePath); - #elseif hxCodec + #elseif hxvlc playVideoNative(rawFilePath); #else throw "No video support for this platform!"; @@ -102,7 +102,7 @@ class VideoCutscene public static function isPlaying():Bool { - #if (html5 || hxCodec) + #if (html5 || hxvlc) return vid != null; #else return false; @@ -135,7 +135,7 @@ class VideoCutscene } #end - #if hxCodec + #if hxvlc static function playVideoNative(filePath:String):Void { // Video displays OVER the FlxState. @@ -152,10 +152,9 @@ class VideoCutscene PlayState.instance.add(vid); PlayState.instance.refresh(); - vid.play(filePath, false); // Resize videos bigger or smaller than the screen. - vid.bitmap.onTextureSetup.add(() -> { + vid.bitmap.onFormatSetup.add(() -> { vid.setGraphicSize(FlxG.width, FlxG.height); vid.updateHitbox(); vid.x = 0; @@ -163,7 +162,13 @@ class VideoCutscene // vid.scale.set(0.5, 0.5); }); - onVideoStarted.dispatch(); + openfl.Assets.loadBytes(filePath).onComplete(function(bytes:openfl.utils.ByteArray):Void + { + if (vid.load(bytes)) + vid.play(); + + onVideoStarted.dispatch(); + }); } else { @@ -182,11 +187,12 @@ class VideoCutscene } #end - #if hxCodec + #if hxvlc if (vid != null) { // Seek to the start of the video. vid.bitmap.time = 0; + if (resume) { // Resume the video if it was paused. @@ -208,7 +214,7 @@ class VideoCutscene } #end - #if hxCodec + #if hxvlc if (vid != null) { vid.pause(); @@ -227,7 +233,7 @@ class VideoCutscene } #end - #if hxCodec + #if hxvlc if (vid != null) { vid.visible = false; @@ -246,7 +252,7 @@ class VideoCutscene } #end - #if hxCodec + #if hxvlc if (vid != null) { vid.visible = true; @@ -265,7 +271,7 @@ class VideoCutscene } #end - #if hxCodec + #if hxvlc if (vid != null) { vid.resume(); @@ -292,7 +298,7 @@ class VideoCutscene } #end - #if hxCodec + #if hxvlc if (vid != null) { vid.stop(); @@ -300,7 +306,7 @@ class VideoCutscene } #end - #if (html5 || hxCodec) + #if (html5 || hxvlc) vid.destroy(); vid = null; #end diff --git a/source/funkin/ui/title/AttractState.hx b/source/funkin/ui/title/AttractState.hx index c5a3d05048..7bd46cc917 100644 --- a/source/funkin/ui/title/AttractState.hx +++ b/source/funkin/ui/title/AttractState.hx @@ -3,8 +3,8 @@ package funkin.ui.title; #if html5 import funkin.graphics.video.FlxVideo; #end -#if hxCodec -import hxcodec.flixel.FlxVideoSprite; +#if hxvlc +import hxvlc.flixel.FlxVideoSprite; #end import funkin.ui.MusicBeatState; @@ -33,7 +33,7 @@ class AttractState extends MusicBeatState playVideoHTML5(ATTRACT_VIDEO_PATH); #end - #if hxCodec + #if hxvlc trace('Playing native video ${ATTRACT_VIDEO_PATH}'); playVideoNative(ATTRACT_VIDEO_PATH); #end @@ -61,7 +61,7 @@ class AttractState extends MusicBeatState } #end - #if hxCodec + #if hxvlc var vid:FlxVideoSprite; function playVideoNative(filePath:String):Void @@ -73,9 +73,15 @@ class AttractState extends MusicBeatState { vid.zIndex = 0; vid.bitmap.onEndReached.add(onAttractEnd); - add(vid); - vid.play(filePath, false); + + openfl.Assets.loadBytes(filePath).onComplete(function(bytes:openfl.utils.ByteArray):Void + { + if (vid.load(bytes)) + vid.play(); + + onVideoStarted.dispatch(); + }); } else { @@ -108,7 +114,7 @@ class AttractState extends MusicBeatState } #end - #if hxCodec + #if hxvlc if (vid != null) { vid.stop(); @@ -116,7 +122,7 @@ class AttractState extends MusicBeatState } #end - #if (html5 || hxCodec) + #if (html5 || hxvlc) vid.destroy(); vid = null; #end diff --git a/tests/unit/project.xml b/tests/unit/project.xml index dfbf06502d..6f534e2296 100644 --- a/tests/unit/project.xml +++ b/tests/unit/project.xml @@ -24,7 +24,7 @@ - + diff --git a/tests/unit/test.hxml b/tests/unit/test.hxml index cece0c43ad..f6e9cd65a2 100644 --- a/tests/unit/test.hxml +++ b/tests/unit/test.hxml @@ -13,7 +13,7 @@ -lib haxeui-core -lib haxeui-flixel -lib flxanimate --lib hxCodec +-lib hxvlc -lib thx.semver -lib json2object -lib tink_json diff --git a/tests/unit/test.hxml-old b/tests/unit/test.hxml-old index e8a7d9bde1..b91276cefd 100644 --- a/tests/unit/test.hxml-old +++ b/tests/unit/test.hxml-old @@ -15,7 +15,7 @@ -lib haxeui-core -lib haxeui-flixel -lib flxanimate --lib hxCodec +-lib hxvlc -lib thx.semver -lib json2object -lib tink_json @@ -48,7 +48,7 @@ -lib haxeui-flixel -lib polymod -lib flxanimate --lib hxCodec +-lib hxvlc -lib thx.semver -lib json2object -lib tink_json From 32422558b09fc08800b4df513fb2c112130cf832 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Sat, 1 Jun 2024 15:43:16 +0300 Subject: [PATCH 02/16] `hxvlc` isn't only for `desktop`. --- Project.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.xml b/Project.xml index ede49916d0..230ec73b9e 100644 --- a/Project.xml +++ b/Project.xml @@ -123,7 +123,7 @@ - + From 226073ff18fb927578e9510431b3346cbcf7d110 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Sun, 2 Jun 2024 05:03:05 +0000 Subject: [PATCH 03/16] Oops --- source/funkin/play/cutscene/VideoCutscene.hx | 4 +++- source/funkin/ui/title/AttractState.hx | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index 19fefef28f..08eafc573b 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -165,9 +165,11 @@ class VideoCutscene openfl.Assets.loadBytes(filePath).onComplete(function(bytes:openfl.utils.ByteArray):Void { if (vid.load(bytes)) + { vid.play(); - onVideoStarted.dispatch(); + onVideoStarted.dispatch(); + } }); } else diff --git a/source/funkin/ui/title/AttractState.hx b/source/funkin/ui/title/AttractState.hx index 7bd46cc917..d45123e9e1 100644 --- a/source/funkin/ui/title/AttractState.hx +++ b/source/funkin/ui/title/AttractState.hx @@ -79,8 +79,6 @@ class AttractState extends MusicBeatState { if (vid.load(bytes)) vid.play(); - - onVideoStarted.dispatch(); }); } else From 0704bdde693db6eea32460f401a77895a2ea796b Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Sun, 2 Jun 2024 05:09:31 +0000 Subject: [PATCH 04/16] Doesn't use stripped paths for `hxvlc`. --- source/funkin/play/cutscene/VideoCutscene.hx | 2 +- source/funkin/ui/title/AttractState.hx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index 08eafc573b..e1bea294d3 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -94,7 +94,7 @@ class VideoCutscene #if html5 playVideoHTML5(rawFilePath); #elseif hxvlc - playVideoNative(rawFilePath); + playVideoNative(filePath); #else throw "No video support for this platform!"; #end diff --git a/source/funkin/ui/title/AttractState.hx b/source/funkin/ui/title/AttractState.hx index d45123e9e1..0032933a55 100644 --- a/source/funkin/ui/title/AttractState.hx +++ b/source/funkin/ui/title/AttractState.hx @@ -17,7 +17,13 @@ import funkin.ui.MusicBeatState; */ class AttractState extends MusicBeatState { + #if html5 static final ATTRACT_VIDEO_PATH:String = Paths.stripLibrary(Paths.videos('toyCommercial')); + #end + + #if hxvlc + static final ATTRACT_VIDEO_PATH:String = Paths.videos('toyCommercial'); + #end public override function create():Void { From 458af699b469918c5fd7e71f1ffeda27f0cc759c Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Wed, 5 Jun 2024 19:44:44 +0300 Subject: [PATCH 05/16] Update `hxvlc` release. --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 0e8c3cce8b..8a985bb603 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.5.4" + "version": "1.5.5" }, { "name": "hxcpp", From 9ec5c489f59b2f8e93205801133fd62afbc4ce7c Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Tue, 11 Jun 2024 06:57:58 +0300 Subject: [PATCH 06/16] Update to the latest release. --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 8a985bb603..f42722a77c 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.5.5" + "version": "1.6.0" }, { "name": "hxcpp", From a5431596e7256f5e4d0b92084522ff316e698c50 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:03:12 +0300 Subject: [PATCH 07/16] Update release (again) --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index f42722a77c..bfbf0e6d71 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.6.0" + "version": "1.6.1" }, { "name": "hxcpp", From 03be805ce296045610bc3dbbc28a5776fdef343c Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:30:29 +0000 Subject: [PATCH 08/16] Use `getBytes` instead of `loadBytes`. --- source/funkin/play/cutscene/VideoCutscene.hx | 11 ++++------- source/funkin/ui/title/AttractState.hx | 7 ++----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index e1bea294d3..011be4b0a9 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -162,15 +162,12 @@ class VideoCutscene // vid.scale.set(0.5, 0.5); }); - openfl.Assets.loadBytes(filePath).onComplete(function(bytes:openfl.utils.ByteArray):Void + if (vid.load(openfl.Assets.getBytes(filePath))) { - if (vid.load(bytes)) - { - vid.play(); + vid.play(); - onVideoStarted.dispatch(); - } - }); + onVideoStarted.dispatch(); + } } else { diff --git a/source/funkin/ui/title/AttractState.hx b/source/funkin/ui/title/AttractState.hx index 0032933a55..81684a8611 100644 --- a/source/funkin/ui/title/AttractState.hx +++ b/source/funkin/ui/title/AttractState.hx @@ -81,11 +81,8 @@ class AttractState extends MusicBeatState vid.bitmap.onEndReached.add(onAttractEnd); add(vid); - openfl.Assets.loadBytes(filePath).onComplete(function(bytes:openfl.utils.ByteArray):Void - { - if (vid.load(bytes)) - vid.play(); - }); + if (vid.load(openfl.Assets.getBytes(filePath))) + vid.play(); } else { From c62b226d955243e021df06bbbb94ab1c967c228f Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:30:14 +0300 Subject: [PATCH 09/16] Update hmm.json --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index bfbf0e6d71..843215db8b 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.6.1" + "version": "1.6.2" }, { "name": "hxcpp", From 54a718a2564edb97e92c3612923f2561f23fb59c Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:59:08 +0300 Subject: [PATCH 10/16] Update hxvlc version l. --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 843215db8b..008afed369 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.6.2" + "version": "1.7.0" }, { "name": "hxcpp", From e2ed22a7196572c105b98bf1baaddb10be2c5807 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Thu, 4 Jul 2024 13:05:15 +0300 Subject: [PATCH 11/16] New version --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 008afed369..4a0052d601 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.7.0" + "version": "1.7.1" }, { "name": "hxcpp", From bf519dceb98e2203c71f6cd3614955ac661a8bc2 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Sat, 24 Aug 2024 23:24:53 +0300 Subject: [PATCH 12/16] Update hmm.json --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 4a0052d601..6354231437 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.7.1" + "version": "1.8.1" }, { "name": "hxcpp", From 9c5765c8acad333f415ea79e24aa9a4f0a5ac09c Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Tue, 3 Sep 2024 22:23:12 +0300 Subject: [PATCH 13/16] Update hmm.json --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 6354231437..820b45f671 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.8.1" + "version": "1.8.2" }, { "name": "hxcpp", From dff28f3526a7356adf21ccc2287c23c281078843 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Wed, 18 Sep 2024 00:19:58 +0300 Subject: [PATCH 14/16] Update hmm.json --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 820b45f671..51f93e2cc1 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.8.2" + "version": "1.8.3" }, { "name": "hxcpp", From 8c5f78601923456a6bed9387b3411365710d109b Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:49:49 +0300 Subject: [PATCH 15/16] Update hmm.json --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 51f93e2cc1..4ce8d2c6c4 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.8.3" + "version": "1.8.4" }, { "name": "hxcpp", From c993c4f2eba40b0124a523193e4d0e38a09094c0 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Fri, 20 Sep 2024 00:49:22 +0300 Subject: [PATCH 16/16] Update hmm.json --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 4ce8d2c6c4..606ef2b854 100644 --- a/hmm.json +++ b/hmm.json @@ -79,7 +79,7 @@ { "name": "hxvlc", "type": "haxelib", - "version": "1.8.4" + "version": "1.8.5" }, { "name": "hxcpp",