I am trying to store the location of the last play/pause event, then move the progress to that location on the next launch, a common feature I feel I should provide. I have my project all working nicely then I realized it breaks for Android <=5? Because I am storing the entire this._audioProvider.tracks[i] object via something like this.storage.set(curTrack, this._audioProvider.tracks[audioID]); and the Storage module uses JSON.stringfy which threws an error about circular reference for Android <=5.
It is bit of a mystery why it worked on Android 7 anyway since it is still calling JSON.stringfy I am assuming?
I am storing the whole object as opposed to individual pieces because I spent a lot of time trying to figure out the structure of the this._audioProvider.tracks[audioID]) and manually setting durationprogress and completed doesn't seem to get the job done because some of the variables are private/not writable?
I tried to use other JSON stringfy libraries but that means I have to not use Storage or hack it.
Anyway, any advice would be welcome. Maybe on the structure of the this._audioProvider.tracks[audioID]), or advice on how to storage progress and duration and setting those on next launch. Thanks!
Hi,
I am trying to store the location of the last play/pause event, then move the progress to that location on the next launch, a common feature I feel I should provide. I have my project all working nicely then I realized it breaks for Android <=5? Because I am storing the entire
this._audioProvider.tracks[i]
object via something likethis.storage.set(curTrack, this._audioProvider.tracks[audioID]);
and the Storage module uses JSON.stringfy which threws an error about circular reference for Android <=5.It is bit of a mystery why it worked on Android 7 anyway since it is still calling JSON.stringfy I am assuming?
I am storing the whole object as opposed to individual pieces because I spent a lot of time trying to figure out the structure of the
this._audioProvider.tracks[audioID])
and manually settingduration
progress
andcompleted
doesn't seem to get the job done because some of the variables are private/not writable?I tried to use other JSON stringfy libraries but that means I have to not use Storage or hack it.
Anyway, any advice would be welcome. Maybe on the structure of the
this._audioProvider.tracks[audioID])
, or advice on how to storage progress and duration and setting those on next launch. Thanks!