add pip backward/forward btns

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-01 10:04:11 +08:00
parent 6661332316
commit 350a52510c
7 changed files with 225 additions and 23 deletions

View File

@@ -356,10 +356,65 @@ extension type AndroidHelper._(jni$_.JObject _$this) implements jni$_.JObject {
static final _id_enterPip = _class.staticMethodId(
r'enterPip',
r'(JII)V',
r'(JIIZZ)V',
);
static final _enterPip =
jni$_.ProtectedJniExtensions.lookup<
jni$_.NativeFunction<
jni$_.JThrowablePtr Function(
jni$_.Pointer<jni$_.Void>,
jni$_.JMethodIDPtr,
jni$_.VarArgs<
(
jni$_.Int64,
jni$_.Int32,
jni$_.Int32,
jni$_.Int32,
jni$_.Int32,
)
>,
)
>
>('globalEnv_CallStaticVoidMethod')
.asFunction<
jni$_.JThrowablePtr Function(
jni$_.Pointer<jni$_.Void>,
jni$_.JMethodIDPtr,
core$_.int,
core$_.int,
core$_.int,
core$_.int,
core$_.int,
)
>();
/// from: `static public void enterPip(long engineId, int width, int height, boolean isLive, boolean isPlaying)`
static void enterPip(
core$_.int engineId,
core$_.int width,
core$_.int height,
core$_.bool isLive,
core$_.bool isPlaying,
) {
final _$$classRef = _class.reference;
_enterPip(
_$$classRef.pointer,
_id_enterPip.pointer,
engineId,
width,
height,
isLive ? 1 : 0,
isPlaying ? 1 : 0,
).check();
}
static final _id_updatePipActions = _class.staticMethodId(
r'updatePipActions',
r'(JZZ)V',
);
static final _updatePipActions =
jni$_.ProtectedJniExtensions.lookup<
jni$_.NativeFunction<
jni$_.JThrowablePtr Function(
@@ -379,19 +434,19 @@ extension type AndroidHelper._(jni$_.JObject _$this) implements jni$_.JObject {
)
>();
/// from: `static public void enterPip(long engineId, int width, int height)`
static void enterPip(
/// from: `static public void updatePipActions(long engineId, boolean isLive, boolean isPlaying)`
static void updatePipActions(
core$_.int engineId,
core$_.int width,
core$_.int height,
core$_.bool isLive,
core$_.bool isPlaying,
) {
final _$$classRef = _class.reference;
_enterPip(
_updatePipActions(
_$$classRef.pointer,
_id_enterPip.pointer,
_id_updatePipActions.pointer,
engineId,
width,
height,
isLive ? 1 : 0,
isPlaying ? 1 : 0,
).check();
}
}

View File

@@ -189,7 +189,12 @@ abstract final class PageUtils {
return (min <= aspectRatio) && (aspectRatio <= max);
}
static void enterPip({int? width, int? height}) {
static void enterPip({
int? width,
int? height,
required bool isLive,
required bool isPlaying,
}) {
if (width != null &&
height != null &&
!_fitsInAndroidRequirements(width, height)) {
@@ -205,6 +210,8 @@ abstract final class PageUtils {
PlatformDispatcher.instance.engineId!,
width ?? 16,
height ?? 9,
isLive,
isPlaying,
);
}