NativeScript / NativeScript/plugins

[@nativescript/imagepicker] MediaMetadataRetriever.setDataSource fails with status = 0xFFFFFFEA

Open
#657 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
206
Forks
123
Avg merge
2d 1h
Merged PRs (30d)
1

Description

Device: Samsung S21

Description

When selecting a video using @nativescript/imagepicker, the returned file path is a content:// URI.
Calling Android APIs such as:

android.media.MediaMetadataRetriever.setDataSource(item.path);

or

android.media.ThumbnailUtils.createVideoThumbnail(item.path, ...)

throws:

Error: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA

This happens because these overloads expect a real filesystem path, not a content:// URI.

Steps to Reproduce

Create imagepicker:

let imagePickerObj = imagePickerPlugin.create({
          mode: "multiple",  android: { use_photo_picker: true }});

Pick a video from gallery.

Try to generate metadata or thumbnail:

let retriever = new android.media.MediaMetadataRetriever();
retriever.setDataSource(item.path); // crashes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the @nativescript/imagepicker Android handling for use_photo_picker and trace how item.path is returned for a selected video. Reproduce the failure with MediaMetadataRetriever.setDataSource(item.path) and ThumbnailUtils.createVideoThumbnail; done means a selected video can be passed to Android metadata or thumbnail APIs without the reported status error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, typescript
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.