Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49308

Using Media Plugin takes too much time to load audio from URL in initial

$
0
0

@sagargandhi wrote:

Ionic Media Plugin is taking too much long time to load the audio from URL.It is taking approx 30 to 40 seconds initially.
Please tell me is there is any way to stream the music properly so that it starts playing after 5 to 10 seconds of delay in start.

This is my code which I am using:-
import {Media , MediaObject } from ‘@ionic-native/media’;
@Component({
selector: ‘page-audio’,
templateUrl: ‘audiolist.html’
})
export class AudioPage {
radio: MediaObject ;
constructor(public navCtrl: NavController,private media: Media) {
this.tracks = [
{title: ‘Something About You’,path:‘http://www.noiseaddicts.com/samples_1w72b820/2558.mp3’,playing: false, progress: 0},
{title: ‘Run’,playing: false, path:‘http://www.noiseaddicts.com/samples_1w72b820/2537.mp3’,progress: 0},
{title: ‘Breate’, playing: false, path:‘assets/sounds/audiothree.mp3’,progress: 0},
];
}
async playTrack(track){
this.radio = new MediaPlugin(track.path);
this.radio.play();
}

}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49308

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>