Skip to content

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

Description

@MiguelGonc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions