2024-09-21 00:11:12 +00:00
|
|
|
package funkin.graphics.video;
|
|
|
|
|
2024-12-17 14:43:16 +00:00
|
|
|
#if hxvlc
|
|
|
|
import hxvlc.flixel.FlxVideoSprite;
|
2025-06-29 06:40:04 +00:00
|
|
|
import funkin.Preferences;
|
2024-09-21 00:11:12 +00:00
|
|
|
|
|
|
|
/**
|
2024-12-17 14:43:16 +00:00
|
|
|
* Not to be confused with FlxVideo, this is a hxvlc based video class
|
2024-09-21 00:11:12 +00:00
|
|
|
* We override it simply to correct/control our volume easier.
|
|
|
|
*/
|
2025-04-17 17:29:26 +00:00
|
|
|
@:nullSafety
|
2024-09-21 00:11:12 +00:00
|
|
|
class FunkinVideoSprite extends FlxVideoSprite
|
|
|
|
{
|
|
|
|
public function new(x:Float = 0, y:Float = 0)
|
|
|
|
{
|
|
|
|
super(x, y);
|
2025-06-29 06:40:04 +00:00
|
|
|
// null safety fucking SUCKS
|
|
|
|
if (bitmap != null)
|
|
|
|
{
|
|
|
|
bitmap.onOpening.add(function():Void {
|
|
|
|
if (bitmap != null) bitmap.audioDelay = Preferences.globalOffset * 1000; // Microseconds
|
|
|
|
});
|
|
|
|
}
|
2024-09-21 00:11:12 +00:00
|
|
|
}
|
|
|
|
}
|
2024-09-23 18:45:12 +00:00
|
|
|
#end
|