Open zhudingshibai opened 6 years ago
Are you using the cordova plugin Media?
"cordova-plugin-media": "^3.0.1", "cordova-plugin-streaming-media": "^1.0.2",
I installed those two .
It's a bug of cordova plugin Media ?
I use WebAudioProvider now.
It can play again, but can't display pause and play button, it always refreshing...
Hmm it is hard to tell, it worked fine when I tested it back then. I will try to look into it whenever I find some spare time.
cordova-plugin-media
releases the track when they complete, even if ionic-audio
doesn't. The simple solution is to just delete and re-create the track from the same source data once it completes. Most modern browsers will still have the entire song cached so you lose nothing in performance.
@codinronan That makes sense and explains why so many people are reporting the same issues. There are so many different use cases that it is hard to find one approach that works for all.
@codinronan Can you let me know how can I recreate the audio track after the track is released by the plugin. I mean which method to use to re-create it again?
I an using this for an ionic app. The mp3 file can only play once .
this is the console.log messages:
play Loading track http://***/APP/DonkeyDonkey.mp3 Playing audio sample 'http://***/APP/DonkeyDonkey.mp3' Playing stream with AVPlayer & default rate Playing track http://***/APP/DonkeyDonkey.mp3 Finished playback Track finished Media with id 1e10e9b5-6b8e-b325-379f-e45b8377ff7d released Released track http://***/APP/DonkeyDonkey.mp3
play again: Loading track http://***/APP/DonkeyDonkey.mp3 Will use resource 'http://***/APP/DonkeyDonkey.mp3' from the Internet. Audio error => track http://***/APP/DonkeyDonkey.mp3 [object Object] Loading track http://***/APP/DonkeyDonkey.mp3 Audio error => track http://***/APP/DonkeyDonkey.mp3 [object Object]
config:
from.tracks = [{ src: 'http://***' + encodeURI(from.arr_people.audio), artist: '', title: '', art: '', preload: 'metadata' }];
HTML : <audio-track #audio *ngFor="let track of tracks" [track]="track" (onFinish)="onTrackFinished($event)"> <ion-item style="background-color:rgb(117, 165, 236)" [hidden]='!playing'>