【问题标题】:check if the device supports 4K [duplicate]检查设备是否支持 4K [重复]
【发布时间】:2018-09-03 18:05:29
【问题描述】:

我有一个任务是在播放特定视频之前检查 android 设备是否支持 4K。 我尝试检查一些选项,但找不到适合此任务的简洁解决方案。 其中之一是使用 MediaCodec 来获取 videoCapabilities,但它并没有给我我想要的东西。 我还尝试了一个我看到的解决方案: Detecting 4K UHD screens on Android 有没有办法提前检测设备是否能够以 4K UHD 输出?

【问题讨论】:

标签: android


【解决方案1】:

您可以只检查屏幕上的像素并相应地执行操作。我们知道 4K 超高清屏幕有 3840 x 2160 像素。所以在你的代码中:

Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;

if(width >= 2160 && height >= 3840)
   //means support UHD. do the job.

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-26
  • 1970-01-01
  • 2011-07-02
  • 2013-02-25
相关资源
最近更新 更多