Capacitor-plugin-playlist: no audio on Android

Q) I’ve got this plugin installed and building, but no sound when I try to load the hardcoded mp3 in the example below, any ideas?

  • Plugin: https://github.com/phiamo/capacitor-plugin-playlist
  • AudioProvider is the example file from that repo.
  • My example player class:
import { Component, OnInit } from '@angular/core';
import { AudioProvider } from '../Services/AudioProvider';


@Component({
  selector: 'app-player',
  templateUrl: 'player.page.html',
  styleUrls: ['player.page.scss'],
})
export class PlayerPage implements OnInit {

  public isPlaying: boolean = false;
  public audioTrack: any;

  constructor(
    public _AudioProvider: AudioProvider
  ) {
  }

  ngOnInit() {
    this.audioTrack = {
      isStream: true,
      assetUrl: "https://ia802508.us.archive.org/5/items/testmp3testfile/mpthreetest.mp3",
      artist: 'Whatever Artist',
      album: 'No Album',
      title: "Some title"
    };

    this._AudioProvider.init().then(() => {
      this._AudioProvider.addItem(this.audioTrack);
    });
  }

  play() {
    this._AudioProvider.play();
    this.isPlaying = this._AudioProvider.isPlaying;
  }


}

Thank you!

My system setup::

Ionic:

   Ionic CLI                     : 6.13.1 (/Users/daveshirman/.nvm/versions/node/v15.10.0/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.5.5
   @angular-devkit/build-angular : 0.1101.4
   @angular-devkit/schematics    : not installed
   @angular/cli                  : 11.1.4
   @ionic/angular-toolkit        : 3.1.0

Capacitor:

   Capacitor CLI   : 2.4.6
   @capacitor/core : 2.4.6

Utility:

   cordova-res                          : 0.15.3
   native-run (update available: 1.3.0) : 0.2.8

System:

   NodeJS : v15.10.0 (/Users/daveshirman/.nvm/versions/node/v15.10.0/bin/node)
   npm    : 7.5.3
   OS     : macOS Big Sur
1 Like

No sound: Are there any errors in the console? Connect to device, check on both Chrome browser and the Android Studio logs. Debugging guide.

Android setup: registered plugin in Main Activity, etc?

Last advice, is to open issues on the plugin repo since the authors know it best. Looks like you’ve done that. :slight_smile:

Thanks @netkow - this is running on the device and there are no errors in the console.

What I do see is:

V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 55614574, pluginId: PlaylistPlugin, methodName: play
V/Capacitor: callback: 55614574, pluginId: PlaylistPlugin, methodName: play, methodData: {}
I/RmxAudioPlayer: play

Android setup is all good, yes.

Yes you’re correct re github issue opened, thank again.