No streaming audio - buffering in iOS
I don't know if this is a cordova-plugin-media issue, but on iOS the AVPlayer does not play the file right away. It takes about 7-10 seconds to download the entire file then it starts playing. Is it supposed to force the stream in the progressive download from an HTTPS source (amazon s3)?
The same happens to me, with my slow Internet takes about 40 seconds to audio starts
Does progressive download work if you set the plugin to use HTML audio?
How can I do that?
Does progressive download work if you set the plugin to use HTML audio?
If you run the project with ionic serve it uses HTML audio by default
I see, yes with HTML audio plays right away.
I guess the issue is then related to the Media plugin
I found this PR https://github.com/apache/cordova-plugin-media/pull/62 from a year ago that solves the streaming in cordova-plugin-media 🤔
Yeah I have that streaming code in my plugin src, it looks like it was merged over a year ago. It is still not streaming though. I tried dumping the plugins and reinstalling everything but the issue persists.
I was able to perform the streaming of mp3 file, the trick is use mu3 file instead your mp3 file.
So I get my mp3 file e create a mu3 file like this:
#EXTM3U
#EXTINF:924, Example artist - Example title
http://s3.amazonaws.com/path/my_audio_file.mp3
The 924 number after #EXTINF: represents the time of the audio (my_audio_file.mp3) in seconds.
More about M3U: Click Here
And save the above file as file.m3u
Then I upload the m3u file and change in the controller to use it, instead of mp3 file. And plays right away.
But the ionic-audio dosen't works 100% with mu3 file, @arielfaur take a look:

The progress bar works fine, but the size of the time gets broken, I think this is simple to adjust.
Best regards folks
Thanks Cesar! Life saver info! I was struggling with this for a while and was about to just force html5 audio. :)
@pauval08 , how did you this? post your code please
Hey I got this working and load times are much better. However, seekTo no longer works! Did you have this issue too? Any solutions?
Many thanks!
Hi ceaser. I was build an online radio streaming radio app. I had 10 sec lagging. So i used your method. Created mu3 amd m3u files. Hosted them in server. But i cannot stream them.
@jags619 use m3u files only works with the cordova plugin media: https://github.com/apache/cordova-plugin-media, but I'm still facing some other issues yet such as get the duration of the media, get the current position and others.
@CeasarOliveira I used cordova plugin media but it is not playing. The m3u file is hosted at http://crawler.quackfoot.com/acorab.m3u. The m3u file is being played at vlc though. It doesnot play in android.
On Tue, Aug 22, 2017 at 5:47 PM, CesarOliveira [email protected] wrote:
@jags619 https://github.com/jags619 use m3u files only works with the cordova plugin media: https://github.com/apache/cordova-plugin-media, but I'm still facing some other issues yet such as get the duration of the media, get the current position and others.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arielfaur/ionic-audio/issues/95#issuecomment-324005390, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5iHE-RqqIH7stj7u_7Ap3UKGdLXEwaks5sasNogaJpZM4MFi5j .
@jags619 I test your m3u file in my app on iOS and works fine I don't have an android to test it =(
here is the code:
import { Media, MediaObject } from 'ionic-native/media';
export class TestPage { constructor(private media: Media) { this.media.create("http://crawler.quackfoot.com/acorab.m3u"); this.media.play(); this.media.pause(); } }
and also import Media in app.module.ts
@CeasarOliviera I am using ionic 1 angular js. and have app.js as main js file. I donot know how to implement this typescript in there. Can you help me
On Fri, Aug 25, 2017 at 6:46 PM, CesarOliveira [email protected] wrote:
@jags619 https://github.com/jags619 I test your m3u file in my app on iOS and works fine I don't have an android to test it =(
here is the code:
import { Media, MediaObject } from '';
export class TestPage { constructor(private media: Media) { this.media.create("http://crawler.quackfoot.com/acorab.m3u"); this.media.play(); this.media.pause(); } }
and also import Media in app.module.ts
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arielfaur/ionic-audio/issues/95#issuecomment-324913287, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5iHBiUJqGPqPD1x8vMh_sWSOCFfvwhks5sbsW_gaJpZM4MFi5j .
I am using cordova plugin cordova-plugin-media for ionic 1 version. and code is
var src="http://crawler.quackfoot.com/acorab.m3u"; var my_media = new Media(src, onSuccess, onError);
my_media.play();
I cannot play the sound.
On Sat, Aug 26, 2017 at 11:52 AM, Jags ojha [email protected] wrote:
@CeasarOliviera I am using ionic 1 angular js. and have app.js as main js file. I donot know how to implement this typescript in there. Can you help me
On Fri, Aug 25, 2017 at 6:46 PM, CesarOliveira [email protected] wrote:
@jags619 https://github.com/jags619 I test your m3u file in my app on iOS and works fine I don't have an android to test it =(
here is the code:
import { Media, MediaObject } from '';
export class TestPage { constructor(private media: Media) { this.media.create("http://crawler.quackfoot.com/acorab.m3u"); this.media.play(); this.media.pause(); } }
and also import Media in app.module.ts
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arielfaur/ionic-audio/issues/95#issuecomment-324913287, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5iHBiUJqGPqPD1x8vMh_sWSOCFfvwhks5sbsW_gaJpZM4MFi5j .
@jags619 if you change the URL http://crawler.quackfoot.com/acorab.m3u for another URL of a MP3 file, the MP3 plays the sound?
#cesarOlivieira. Yes it does but its around 10 sec lag.
On Mon, Aug 28, 2017 at 6:38 PM, CesarOliveira [email protected] wrote:
@jags619 https://github.com/jags619 if you change the URL http://crawler.quackfoot.com/acorab.m3u for another URL of a MP3 file, the MP3 plays the sound?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arielfaur/ionic-audio/issues/95#issuecomment-325345141, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5iHCEv-BPNNrpgPPu7hQZCZtQzQDbXks5scrhNgaJpZM4MFi5j .
The lag its because it download the file first. It seems your code its ok but I don't know why your m3u file doesn't work, in iOS works fine and I don't have an android to test . Remember that you have to run on the device.
Yes i am running on real device. Is there other way of directly playing instead of first downloading the file/meta-data
On Mon, Aug 28, 2017 at 8:03 PM, CesarOliveira [email protected] wrote:
The lag its because it download the file first. It seems your code its ok but I don't know why your m3u file doesn't work, in iOS works fine and I don't have an android to test . Remember that you have to run on the device.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arielfaur/ionic-audio/issues/95#issuecomment-325366419, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5iHJTO9fJm8YYZQxBi6ouxQSfNa0upks5scsxHgaJpZM4MFi5j .
There is this other plugin: https://ionicframework.com/docs/native/streaming-media/
But I think it doesn't work for Ionic 1
Tried this also same issue audio lagging
On 29 Aug 2017 19:17, "CesarOliveira" [email protected] wrote:
There is this other plugin: https://ionicframework.com/ docs/native/streaming-media/
But I think it doesn't work for Ionic 1
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arielfaur/ionic-audio/issues/95#issuecomment-325664813, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5iHIe6rXBKraxNj0Ilbe8YreaXsmmhks5sdBMEgaJpZM4MFi5j .
@CesarOliveira did you solved the problem with seekTo and duration of media using m3u? I'm facing the same problem, I tried a lot of solutions but none of them solved the problem.
@CesarOliveira did you solved the problem with seekTo and duration of media using m3u? I'm facing the same problem, I tried a lot of solutions but none of them solved the problem.
sadly no, I had to deal with other projects
@CesarOliveira did you solved the problem with seekTo and duration of media using m3u? I'm facing the same problem, I tried a lot of solutions but none of them solved the problem.
sadly no, I had to deal with other projects
:( Thank you for your answer. I'm considering changing the technology of my app because ionic seems a legacy technology already.