Skip to content

Android 14 Won't Play MP3 files #395

@bkervaski

Description

@bkervaski

Bug Report

Problem

On Android 14 (Pixel 5) I can no longer play MP3 files from the bundle either directly or via https://localhost.

Using Cordova Android 12.0.1 and cordova-plugin-media 7.0.0

I'm using Vite, so all of the files end up in assets/sound-abc123.mp3

Not doing anything fancy, just:

let foo = new Media('assets/sound-abc123.mp3') or https://localhost/assets/sound-abc123.mp3
foo.play()

/storage/emulated/0/Android/data/com.bundle.id/files/assets/sound-abc123.mp3: open failed: ENOENT (No such file or directory)

It WILL play, however, from the internet, i.e., new Media('https://some.website.abc/foo.mp3')

Thanks for any help!

What is expected to happen?

The sound should play.

What does actually happen?

I get a code 1 (or file not found when I experiment with other ways to get the file)

Information

This code worked on Android 12.

Command or Code

let foo = new Media('assets/sound-abc123.mp3') or https://localhost/assets/sound-abc123.mp3
foo.play()

Environment, Platform, Device

Android 14, Pixel 5

Version information

Checklist

  • [X ] I searched for existing GitHub issues
  • [X ] I updated all Cordova tooling to most recent version
  • [X ] I included all the necessary information above

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