使用XComponent播放视频,Xcomponent无论是设置 Surface、Texture类型,在使用image.createPixelMapFromSurface创建pixMap时候一直报错。
let region: image.Region =
{ size: { height: 100, width: 120 }, x: 0, y: 0 };
image.createPixelMapFromSurface(surfaceid, region).then((pixmap) => {
this.pix_map = pixmap
LogUtils.LOGI(this.TAG, "Success to create pixelmap.")
}).catch((res: string) => {
LogUtils.LOGI(this.TAG,
"Failed to create pixelmap. code is " + res) // 一直报错 62980178
});
传的surfaceid存在问题,所传的let surfaceid = this.dataArray[0].id建议更改为surfaceid=this.xcomponentController.getXComponentSurfaceId(); 是没有问题的。