Restart the video when setting the subtitle track.

This commit is contained in:
MAJigsaw77
2025-10-06 01:31:30 +08:00
committed by Hundrec
parent e43ec564e0
commit fa86e53b7d
+14 -6
View File
@@ -10,7 +10,7 @@ import funkin.play.PlayState;
import funkin.graphics.video.FlxVideo;
#end
#if hxvlc
import hxvlc.flixel.FlxVideoSprite;
import funkin.graphics.video.FunkinVideoSprite;
#end
/**
@@ -32,7 +32,7 @@ class VideoCutscene
#end
#if hxvlc
static var vid:FlxVideoSprite;
static var vid:FunkinVideoSprite;
#end
/**
@@ -152,7 +152,7 @@ class VideoCutscene
static function playVideoNative(filePath:String):Void
{
// Video displays OVER the FlxState.
vid = new FlxVideoSprite(0, 0);
vid = new FunkinVideoSprite(0, 0);
if (vid != null)
{
@@ -170,7 +170,11 @@ class VideoCutscene
{
if (spuTrack.psz_name.toLowerCase().contains(DEFAULT_LANGUAGE))
{
if (vid.bitmap.spuTrack != spuTrack.i_id) vid.bitmap.spuTrack = spuTrack.i_id;
if (vid.bitmap.spuTrack != spuTrack.i_id)
{
vid.bitmap.spuTrack = spuTrack.i_id;
vid.bitmap.time = 0;
}
break;
}
@@ -184,8 +188,12 @@ class VideoCutscene
// {
// if (audioTrack.psz_name.toLowerCase().contains(DEFAULT_LANGUAGE))
// {
// if (vid.bitmap.audioTrack != audioTrack.i_id) vid.bitmap.audioTrack = audioTrack.i_id;
//
// if (vid.bitmap.audioTrack != audioTrack.i_id)
// {
// vid.bitmap.audioTrack = audioTrack.i_id;
// vid.bitmap.time = 0;
// }
// break;
// }
// }