Closed azukaar closed 1 month ago
any log?
Logs here: https://pastebin.com/7FKTFcuB
And code for displaying the texture:
Future<void> _getTextureSize() async {
final videoPlayerPlatform =
VideoPlayerPlatform.instance as MdkVideoPlayerPlatform;
if (widget.player != null) {
final size = await widget.player.textureSize;
if (size != null && mounted) {
setState(() {
_textureSize = size;
});
}
}
}
@override
Widget build(BuildContext context) {
if (_textureSize == null) {
return const Center(child: CircularProgressIndicator());
}
return AspectRatio(
aspectRatio: _textureSize!.width / _textureSize!.height,
child: Texture(
textureId: widget.player.textureId.value ?? 0,
),
);
}
the video size is 1928*1080, so 16:9. why do you think it should be 4:3 ?
Sorry I mis-interpreted the data, I thought the decoder was adding the border, closing now
When playing a different aspect ratio on Android with hardware decoder (does not happen in software I think) the aspect ratio seems to be forced to be 16:9 The result for a 4:3 video is a texture that has a 16:9 aspect ratio, with black bars on the side. Then the player itself will add back bar on the top/bottom to match the screen size (if the screen is not 16:9). Here's an example: