private void BtnSkipPrevious_Click(object sender, EventArgs e) { bool isNotKitkat = Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch; if (isNotKitkat) { Jukebox.SkipToPrevious(); } else { JukeboxKitkat.SkipToPrevious(); } }
private void BtnSkipPrevious_LongClick(object sender, View.LongClickEventArgs e) { bool isNotKitkat = Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch; if (isNotKitkat) { Jukebox.Rewind(); } else { JukeboxKitkat.Rewind(); } }
private void RetrieveMediaInformation() { //Syntactic sugar, cause a MediaMetadata and a Mediaplayback event to be fired in the Publisher class. //(MusicController class) //Or in Catcher class, if its Kitkat. if (Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch) { Jukebox.RetrieveMediaInformation(); } else { JukeboxKitkat.RetrieveMediaInformation(); } }
private void BtnPlayPause_Click(object sender, EventArgs e) { bool isNotKitkat = Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch; switch (playbackState) { //If the media is paused, then Play. case PlaybackStateCode.Paused: if (isNotKitkat) { Jukebox.Play(); } else { JukeboxKitkat.Play(); } break; //If the media is playing, then pause. case PlaybackStateCode.Playing: if (isNotKitkat) { Jukebox.Pause(); } else { JukeboxKitkat.Pause(); } break; default: if (isNotKitkat) { Jukebox.Stop(); } else { JukeboxKitkat.Stop(); } break; } }
private void SkbSeekSongTime_StopTrackingTouch(object sender, SeekBar.StopTrackingTouchEventArgs e) { if (Build.VERSION.SdkInt > BuildVersionCodes.KitkatWatch) { //When user stop dragging then seek to the position previously saved in ProgressChangedEvent Jukebox.SeekTo(e.SeekBar.Progress); if (Build.VERSION.SdkInt > BuildVersionCodes.LollipopMr1) { skbSeekSongTime.SetProgress(e.SeekBar.Progress, true); } else { skbSeekSongTime.Progress = e.SeekBar.Progress; } } else { JukeboxKitkat.SeekTo(e.SeekBar.Progress); skbSeekSongTime.Progress = e.SeekBar.Progress; } }