Details
-
Bug
-
Status: Open
-
Blocker
-
Resolution: Unresolved
-
None
-
None
-
None
-
Ionic 3, Angular JS 4
Description
I am trying to play multiple audio tracks one after the other using the Media Plugin.
On pressing play, I download all the tracks as a zip file, and then play them one after the other until the last track is played. This works fine on Android (all models) and also on iOS up to 11.2. On iOS 11.3 onwards, the next track never starts from the beginning, but from a random duration. So basically if an Album has 4 tracks, first one will play from duration 00:00, and then the next ones will start to play from random duration, and never from 00:00.
Code Snippet is below:
{{if (ContainerClass.GetPlatformName() == "android")
{ this._mFile = this.media.create(this._URL + "/" + AlbumNo + "/" + this._fileName[index]); }else if (ContainerClass.GetPlatformName() == "ios")
{ this._mFile = this.media.create((this._URL + "/" + AlbumNo + "/" + this._fileName[index]).replace(/^file:\/\//, '')); }this._mFile.onStatusUpdate.subscribe(status => console.log(status)); this._mFile.stop(); this._mFile.play(); ServicesClass._mFile = this._mFile; ServicesClass._isPlaying = 1; ServicesClass._playingAlbumNo = this.AlbumNo; ServicesClass._isPlaying = 1 this._isPlaying = 1; this._mFile.onSuccess.subscribe(result => { index++; this._playingIndex = index; this._mFile.release(); if (ServicesClass._stopPlaying == false)
{ this.PlayFiles(AlbumNo, index); this.showMp3Player(true); }else
{ return; }}); this._mFile.onError.subscribe(error => console.log('Error!', JSON.stringify(error))); } }}