Fix transparent profile card mp4 rendering
This commit is contained in:
parent
dd4e2cf08c
commit
1542f82dd2
@ -329,6 +329,8 @@ class _LoopingDataCardVapVideo extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _LoopingDataCardVapVideoState extends State<_LoopingDataCardVapVideo> {
|
class _LoopingDataCardVapVideoState extends State<_LoopingDataCardVapVideo> {
|
||||||
|
static const int _legacyRgbLeftAlphaRightMode = 3;
|
||||||
|
|
||||||
VapController? _controller;
|
VapController? _controller;
|
||||||
int _playToken = 0;
|
int _playToken = 0;
|
||||||
bool _failed = false;
|
bool _failed = false;
|
||||||
@ -386,6 +388,8 @@ class _LoopingDataCardVapVideoState extends State<_LoopingDataCardVapVideo> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await controller.setMute(true);
|
await controller.setMute(true);
|
||||||
|
await controller.enableVersion1(true);
|
||||||
|
await controller.setVideoMode(_legacyRgbLeftAlphaRightMode);
|
||||||
await controller.setLoop(widget.loop ? -1 : 0);
|
await controller.setLoop(widget.loop ? -1 : 0);
|
||||||
await controller.setScaleType(_scaleTypeForFit(widget.fit).key);
|
await controller.setScaleType(_scaleTypeForFit(widget.fit).key);
|
||||||
if (!_isCurrent(token, controller)) {
|
if (!_isCurrent(token, controller)) {
|
||||||
|
|||||||
@ -264,6 +264,18 @@ class VapView(
|
|||||||
result.success(null)
|
result.success(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"enableVersion1" -> {
|
||||||
|
val enable = call.argument<Boolean>("enable") ?: false
|
||||||
|
animView.enableVersion1(enable)
|
||||||
|
result.success(null)
|
||||||
|
}
|
||||||
|
|
||||||
|
"setVideoMode" -> {
|
||||||
|
val mode = call.argument<Int>("mode") ?: 1
|
||||||
|
animView.setVideoMode(mode)
|
||||||
|
result.success(null)
|
||||||
|
}
|
||||||
|
|
||||||
"setVapTagContent" -> {
|
"setVapTagContent" -> {
|
||||||
val tag = call.argument<String>("tag")
|
val tag = call.argument<String>("tag")
|
||||||
val contentMap = call.argument<Map<String, String>>("content")
|
val contentMap = call.argument<Map<String, String>>("content")
|
||||||
|
|||||||
@ -67,6 +67,8 @@ public class VapFlutterView: NSObject, FlutterPlatformView {
|
|||||||
scaleType = value
|
scaleType = value
|
||||||
}
|
}
|
||||||
result(nil)
|
result(nil)
|
||||||
|
case "enableVersion1", "setVideoMode":
|
||||||
|
result(nil)
|
||||||
case "setVapTagContent":
|
case "setVapTagContent":
|
||||||
if let args = call.arguments as? [String: Any],
|
if let args = call.arguments as? [String: Any],
|
||||||
let tag = args["tag"] as? String,
|
let tag = args["tag"] as? String,
|
||||||
|
|||||||
@ -396,6 +396,23 @@ class VapController {
|
|||||||
await __channel.invokeMethod('setScaleType', {'scaleType': scaleType});
|
await __channel.invokeMethod('setScaleType', {'scaleType': scaleType});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Enables compatibility mode for legacy RGB/alpha split MP4 resources
|
||||||
|
/// that do not contain a VAP config box.
|
||||||
|
Future<void> enableVersion1(bool enable) async {
|
||||||
|
await __channel.invokeMethod('enableVersion1', {'enable': enable});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets legacy split MP4 mode.
|
||||||
|
///
|
||||||
|
/// Tencent VAP values:
|
||||||
|
/// - 1: alpha left, RGB right
|
||||||
|
/// - 2: alpha top, RGB bottom
|
||||||
|
/// - 3: RGB left, alpha right
|
||||||
|
/// - 4: RGB top, alpha bottom
|
||||||
|
Future<void> setVideoMode(int mode) async {
|
||||||
|
await __channel.invokeMethod('setVideoMode', {'mode': mode});
|
||||||
|
}
|
||||||
|
|
||||||
/// Sets content for a specific VAP tag.
|
/// Sets content for a specific VAP tag.
|
||||||
///
|
///
|
||||||
/// VAP tags are placeholders in the animation file that can be replaced
|
/// VAP tags are placeholders in the animation file that can be replaced
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user