Skip to content

Commit

Permalink
fix #2559
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Apr 14, 2020
1 parent 1386047 commit 05b06f2
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class SystemPlayerManager extends BasePlayerManager {

private long lastTimeStamp = 0;

private boolean isPlaying = false;

@Override
public IMediaPlayer getMediaPlayer() {
return mediaPlayer;
Expand Down Expand Up @@ -76,6 +78,9 @@ public void showDisplay(Message msg) {
if (mediaPlayer != null && holder.isValid() && !release) {
mediaPlayer.setSurface(holder);
}
if (!isPlaying) {
pause();
}
}
}

Expand Down Expand Up @@ -140,20 +145,23 @@ public void setSpeedPlaying(float speed, boolean soundTouch) {
public void start() {
if (mediaPlayer != null) {
mediaPlayer.start();
isPlaying = true;
}
}

@Override
public void stop() {
if (mediaPlayer != null) {
mediaPlayer.stop();
isPlaying = false;
}
}

@Override
public void pause() {
if (mediaPlayer != null) {
mediaPlayer.pause();
isPlaying = false;
}
}

Expand Down Expand Up @@ -238,7 +246,7 @@ private void setSpeed(float speed) {
} else {
Debuger.printfError(" not support setSpeed");
}
} catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
}
Expand Down

0 comments on commit 05b06f2

Please sign in to comment.