Use haxelib release of hxvlc. (#231)
* Update libs.xml * Update VideoCutscene.hx * Fixed bug with videos --------- Co-authored-by: NeeEoo <NeeEoo@users.noreply.github.com>
This commit is contained in:
co-authored by
NeeEoo
parent
b1f265bc5a
commit
f91ee82b73
@@ -12,7 +12,7 @@
|
||||
<git name="hscript-improved" url="https://www.github.com/FNF-CNE-Devs/hscript-improved" ref="custom-classes" />
|
||||
<git name="discord-rpc" url="https://github.com/Aidan63/linc_discord-rpc" />
|
||||
<git name="flxanimate" url="https://github.com/FNF-CNE-Devs/flxanimate" />
|
||||
<git name="hxvlc" url="https://github.com/MAJigsaw77/hxvlc" />
|
||||
<lib name="hxvlc" />
|
||||
|
||||
<!-- Documentation and other features -->
|
||||
<lib name="away3d" />
|
||||
|
||||
@@ -7,7 +7,10 @@ import flixel.addons.display.FlxBackdrop;
|
||||
import sys.io.File;
|
||||
#end
|
||||
import funkin.backend.FunkinText;
|
||||
import haxe.io.FPHelper;
|
||||
import haxe.xml.Access;
|
||||
import haxe.Int64;
|
||||
import flixel.util.FlxTimer;
|
||||
#if VIDEO_CUTSCENES
|
||||
import hxvlc.flixel.FlxVideo;
|
||||
#end
|
||||
@@ -56,6 +59,11 @@ class VideoCutscene extends Cutscene {
|
||||
video.onEndReached.add(video.dispose);
|
||||
video.onEndReached.add(close);
|
||||
|
||||
//cover = new FlxSprite(0, FlxG.height * 0.85).makeSolid(FlxG.width + 50, FlxG.height + 50, 0xFF000000);
|
||||
//cover.scrollFactor.set(0, 0);
|
||||
//cover.screenCenter();
|
||||
//add(cover);
|
||||
|
||||
bg = new FlxSprite(0, FlxG.height * 0.85).makeGraphic(1, 1, 0xFF000000);
|
||||
bg.alpha = 0.5;
|
||||
bg.visible = false;
|
||||
@@ -85,7 +93,12 @@ class VideoCutscene extends Cutscene {
|
||||
videoReady = true;
|
||||
});
|
||||
} else {
|
||||
video.play(localPath);
|
||||
if (video.load(localPath))
|
||||
new FlxTimer().start(0.001, function(tmr:FlxTimer) {
|
||||
video.play();
|
||||
});
|
||||
else
|
||||
close();
|
||||
}
|
||||
add(bg);
|
||||
add(subtitle);
|
||||
@@ -160,13 +173,28 @@ class VideoCutscene extends Cutscene {
|
||||
#if VIDEO_CUTSCENES
|
||||
if (videoReady) {
|
||||
videoReady = false;
|
||||
video.play(localPath);
|
||||
|
||||
if (video.load(localPath))
|
||||
new FlxTimer().start(0.001, function(tmr:FlxTimer) {
|
||||
video.play();
|
||||
});
|
||||
else
|
||||
{
|
||||
close();
|
||||
|
||||
if (loadingBackdrop != null)
|
||||
loadingBackdrop.visible = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (loadingBackdrop != null)
|
||||
loadingBackdrop.visible = false;
|
||||
}
|
||||
@:privateAccess
|
||||
var time = video.time;
|
||||
while (subtitles.length > 0 && subtitles[0].time < time)
|
||||
var time:Int64 = video.time;
|
||||
|
||||
while (subtitles.length > 0 && subtitles[0].time < Math.round(FPHelper.i64ToDouble(time.low, time.high)))
|
||||
setSubtitle(subtitles.shift());
|
||||
|
||||
if (loadingBackdrop != null) {
|
||||
|
||||
Reference in New Issue
Block a user