如何检索放置在从媒体扫描中排除的文件夹中的视频的缩略图

发布于 2024-12-06 05:52:50 字数 314 浏览 3 评论 0原文

我正在尝试获取视频的缩略图。我正在关注这个答案。

我的问题是,我想要制作缩略图的视频是缓存文件夹中带有 .nomedia 文件的文件,因此该视频不会出现在媒体扫描中,并且返回的光标为空。

如何解决保持最小 sdk 级别 =7 的问题?

谢谢!

编辑:开始悬赏该问题的答案:检索文件系统文件夹中视频文件的缩略图,该文件夹被排除在媒体扫描之外,保持项目 Min SDK =7

I'm trying to get a thumbnail of a video. I'm following this answer.

My problem is that the video I want to make the thumbnail is an file in a cache folder with an .nomedia file and for that reason the video doesn't appear in the media scan and the returned cursor is empty.

How can I solve that problem keeping the min sdk level =7?

Thanks!

Edit: Starting a bounty for the answer to that question: Retrieve a thumbnail for a video file in a folder at the filesystem which is excluded from media scan keeping the project Min SDK =7

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

-残月青衣踏尘吟 2024-12-13 05:52:50

尝试通过广播强制扫描媒体文件:

sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory())));

Try force the scan of media file with a broadcast:

sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory())));
∞琼窗梦回ˉ 2024-12-13 05:52:50

如果您可以制作视频文件夹,我告诉您这样做:

Context ctx = getContext();
File folder = ctx.getDir("NewFolder", Context.MODE_PRIVATE);

但是就像这个答案所说:

您无法在 SD 卡上创建此类文件夹。 保存到的所有内容
SD卡可以被其他应用程序访问

此处提取

If you can make the video folder , i tell you to do this :

Context ctx = getContext();
File folder = ctx.getDir("NewFolder", Context.MODE_PRIVATE);

But like this answer says:

You can't create such a folder on sdcard. Everything that's saved onto
sdcard can be accessed by other applications
.

extracted from here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文