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