/// <summary> /// Method that plays the sound on Android. /// </summary> public void PlaySound(SoundboardItem item) { player = new MediaPlayer (); var fd = Xamarin.Forms.Forms.Context.Assets.OpenFd (item.FileName + ".mp3"); player.SetDataSource (fd.FileDescriptor); player.Prepare (); player.Start (); }
public void PlaySound(SoundboardItem item) { this.listview.SelectedItem = null; _selectedSoundboardItem = null; DependencyService.Get<ISoundPlayer> ().PlaySound (item); }