Media player is not looking for correctness on HTC

I work in the application with both the recorder and the player, it is almost over. On most Samsung devices, Motorolla, the Sony app is so stable and works great. When I tried this in htc I ran into a serious problem.

When the sound starts to play, I update it to the arrow. This works great on all other devices, but when it comes to htc(Desire HD, Android 2.3.3) , the promotion moves faster and the media player lags behind in the player. I intercepted a lot and read a lot of posts. Is sound latency a problem in Android 2.3.3 or is it a problem with htc. Anyone have an idea about this? Can someone help me with a good clarification?

+4
source share
1 answer

Set the maximum speed to 500 and run this timer will solve the problem. I tried and it worked for me.

  InsideMMduration = mMediaPlayer.getDuration(); amoungToupdate = InsideMMduration / 500; // TimerTask for updating the SeekBar while playing. task = new TimerTask() { @Override public void run() { Graphbar.post(new Runnable() { @Override public void run() { if (mMediaPlayer != null) { if (playButtonState == MediaMode.PLAY) { if (mMediaPlayer.isPlaying()) { if (!(amoungToupdate * Graphbar.getProgress() >= InsideMMduration)) { int tempP = Graphbar.getProgress(); tempP += 1; Graphbar.setProgress(tempP); enableRewindandForward(); } } } } } }); } }; timer = new Timer(); timer.schedule(task, 0, amoungToupdate); 
+1
source

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


All Articles