【问题标题】:ThumbnailUtils.createVideoThumbnail is not work in samsung tablet 10.1ThumbnailUtils.createVideoThumbnail 在三星平板电脑 10.1 中不起作用
【发布时间】:2014-02-25 19:24:29
【问题描述】:

我尝试创建 android SD 卡视频的缩略图。这是我用来创建视频缩略图的功能

Bitmap thumb = ThumbnailUtils.createVideoThumbnail("sdCard_Video_Path",MediaStore.Video.Thumbnails.MINI_KIND);

但我在所有没有三星平板电脑 10.1 的手机中都能看到视频缩略图。在samsung tablet 10.1 中显示黑色缩略图。

为什么这个功能在samsung tablet 10.1中不起作用

我也在检查位图是否为空

if (thumb != null) {
imageView.setImageBitmap(thumb);

但是samsung tablet 10.1 没有给出任何空位图,但它在缩略图中显示为黑色

help via comment or link.

【问题讨论】:

  • 嗨@Md Abdul Gafur,您找到任何解决方案了吗?我在三星 M30s 设备中也面临同样的问题。
  • 确保您的文件扩展名为 .mp4。在更新文件扩展名后,三星设备也面临同样的问题,它适用于所有设备。

标签: android video thumbnails


【解决方案1】:

您应该将 Android 源代码 (ThumbnailUtils.java) 复制到您的代码中 并替换createVideoThumbnail函数,将setDataSource(link)改为setDataSource(link, new HashMap());

参考:https://code.google.com/p/android/issues/detail?id=35794

【讨论】:

  • 您是否真的这样做并让它发挥作用?如果是这样,您能否详细说明您是如何进行的 - ThumbnailUtils.java 使用了一些隐藏的 API,并且显然不会在 Eclipse 中编译,据我所知。
猜你喜欢
  • 2015-05-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-12-13
  • 1970-01-01
  • 2017-08-01
  • 2011-05-29
  • 2012-02-14
相关资源
最近更新 更多