Is there any example for an Android media player with the addition of player controls in the Notification?

Is there any example for an Android multimedia player with a notification to add player controls like play / pause, previous and next button?

+4
source share
2 answers

// - methods MediaPlayerControl ----------------------------------------- ---- -------

public void start() { mediaPlayer.start(); } public void pause() { mediaPlayer.pause(); } public int getDuration() { return mediaPlayer.getDuration(); } public int getCurrentPosition() { return mediaPlayer.getCurrentPosition(); } public void seekTo(int i) { mediaPlayer.seekTo(i); } public boolean isPlaying() { return mediaPlayer.isPlaying(); } public int getBufferPercentage() { return 0; } public boolean canPause() { return true; } public boolean canSeekBackward() { return true; } public boolean canSeekForward() { return true; } 
0
source
 MediaController mediaController = new MediaController(this); VideoView.setMediaController(mediaController); 

Use MediaController?

0
source

Source: https://habr.com/ru/post/1392651/


All Articles