arielfaur / ionic-audio

An audio player for Ionic 3 and Angular 4. Works with HTML 5 audio or native audio using Cordova Media plugin.
http://arielfaur.github.io/ionic-audio/2.0/index.html
MIT License
321 stars 163 forks source link

play pause #184

Open walid-deutscher opened 6 years ago

walid-deutscher commented 6 years ago

<audio-track #audio *ngFor="let track of myTracks" [track]="track" (onFinish)="onTrackFinished($event)" (onPlay)="onPlay($event)" (onPAuse)="onPAuse($event)">

i want add music control to with event play pause but not work how can i add

walid-deutscher commented 6 years ago

it ok now <audio-track #audio *ngFor="let track of myTracks" # (click)="clickr()" [track]="track" (onFinish)="onTrackFinished($event)">

play(){ this._audioProvider.play(0); } pause(){ this._audioProvider.pause(0); } clickr(){ if(this.mod=="1"){ this.settingMusicControl(); this.musicControls.listen(); this.mod="0" ; } else{ this.musicControls.updateIsPlaying(false); this.mod="1" ; }

i use id 0
because i use just one audoi in my projectect

walid-deutscher commented 6 years ago

case 'music-controls-pause': // Do something console.log('music pause'); this.pause() ; this.musicControls.listen(); this.musicControls.updateIsPlaying(false); break; case 'music-controls-play': // Do something this.play(); console.log('music play');

         this.musicControls.listen(); 
         this.musicControls.updateIsPlaying(true);
         break;
      case 'music-controls-destroy':
jayzyaj commented 6 years ago

How can I post all of the tracks playing at the same time? @walid-deutscher