Rolamix / cordova-plugin-playlist

🎶 A Cordova plugin for Android and iOS with native support for audio playlists, background support, and lock screen controls 🎶
MIT License
33 stars 33 forks source link

Don't work in iOS with Ionic3. #39

Open mgtaio opened 4 years ago

mgtaio commented 4 years ago

Don't work in iOS with Ionic3.

Code:

      this.cdvAudioPlayer.setOptions({ verbose: true, resetStreamOnPause: true }).then(() => {
        this.cdvAudioPlayer.setPlaylistItems([
          // Intersperse good tracks with failures
          { trackId: '1', assetUrl: 'http://streaming1.ondamusicalradio.com:8100/omrfmweb', albumArt: '', artist: 'Mount Nakara', album: 'Test Files', title: 'Test 1', isStream: true }
        ])
        .then(() => {
          this.cdvAudioPlayer.play();
        }).catch((err) => console.log('YourService, cdvAudioPlayer setPlaylistItems error: ', err));
      }).catch((err) => console.log('YourService, cdvAudioPlayer init error: ', err));

App open and close instantly. iOS 13.3.1

Thx

HypeTunes commented 4 years ago

I fixed this issue by making sure all of my values (ID, album. title, etc) were fully defined and not 'undefined'. Then it worked.