VideoCanvas
- Flutter
更新时间不可用
视频画布对象的属性。
@JsonSerializable(explicitToJson: true, includeIfNull: false)
class VideoCanvas {
const VideoCanvas(
{this.uid,
this.subviewUid,
this.view,
this.backgroundColor,
this.renderMode,
this.mirrorMode,
this.setupMode,
this.sourceType,
this.mediaPlayerId,
this.cropArea,
this.enableAlphaMask,
this.position});
@JsonKey(name: 'uid')
final int? uid;
@JsonKey(name: 'subviewUid')
final int? subviewUid;
@JsonKey(name: 'view')
final int? view;
@JsonKey(name: 'backgroundColor')
final int? backgroundColor;
@JsonKey(name: 'renderMode')
final RenderModeType? renderMode;
@JsonKey(name: 'mirrorMode')
final VideoMirrorModeType? mirrorMode;
@JsonKey(name: 'setupMode')
final VideoViewSetupMode? setupMode;
@JsonKey(name: 'sourceType')
final VideoSourceType? sourceType;
@JsonKey(name: 'mediaPlayerId')
final int? mediaPlayerId;
@JsonKey(name: 'cropArea')
final Rectangle? cropArea;
@JsonKey(name: 'enableAlphaMask')
final bool? enableAlphaMask;
@JsonKey(name: 'position')
final VideoModulePosition? position;
factory VideoCanvas.fromJson(Map<String, dynamic> json) =>
_$VideoCanvasFromJson(json);
Map<String, dynamic> toJson() => _$VideoCanvasToJson(this);
}属性
| 参数名 | 描述 |
|---|---|
uid | |
subviewUid | |
view | |
renderMode | 视频渲染模式,详见 RenderModeType。 |
mirrorMode | 视图镜像模式,详见 VideoMirrorModeType。 注:
|
sourceType | 视频源的类型,详见 VideoSourceType。 |
setupMode | 视图设置模式。详见 VideoViewSetupMode。 |
mediaPlayerId | 媒体播放器 ID。可通过 getMediaPlayerId 获取。 |
cropArea | (可选)视频帧的展示区域,详见 Rectangle。其中, |
backgroundColor | |
enableAlphaMask | 注:
(可选)是否开启 Alpha 遮罩渲染:
Alpha 遮罩渲染可以创建具有透明效果的图像,还可以提取视频中的人像。与其他方法结合使用时,可以实现人像画中画、添加水印等效果。 |
position | 视频帧在视频链路中的位置。详见 VideoModulePosition。 |