|
@@ -44,6 +44,7 @@ import com.cooleshow.base.utils.SizeUtils;
|
|
import com.cooleshow.base.utils.TimeUtils;
|
|
import com.cooleshow.base.utils.TimeUtils;
|
|
import com.cooleshow.base.utils.ToastUtil;
|
|
import com.cooleshow.base.utils.ToastUtil;
|
|
import com.cooleshow.base.utils.ToastUtils;
|
|
import com.cooleshow.base.utils.ToastUtils;
|
|
|
|
+import com.cooleshow.base.utils.UiUtils;
|
|
import com.cooleshow.base.utils.UrlUtils;
|
|
import com.cooleshow.base.utils.UrlUtils;
|
|
import com.cooleshow.base.utils.helper.CommonShareHelper;
|
|
import com.cooleshow.base.utils.helper.CommonShareHelper;
|
|
import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
|
|
import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
|
|
@@ -826,7 +827,7 @@ public class MusicHandleActivity_ extends BaseMVPActivity<AcMusicHandleLayoutBin
|
|
long cu = getAudioPlayer().getPlayProgress();
|
|
long cu = getAudioPlayer().getPlayProgress();
|
|
long cu1 = player2.getCu();
|
|
long cu1 = player2.getCu();
|
|
int delayValue = getDelayValue();
|
|
int delayValue = getDelayValue();
|
|
- long expectPlayer2Delay = delayValue > 0 ? cu1 : cu1 - getDelayValue();
|
|
|
|
|
|
+ long expectPlayer2Delay = cu1- delayValue;
|
|
long dif = cu - expectPlayer2Delay;
|
|
long dif = cu - expectPlayer2Delay;
|
|
String text = "演奏进度:" + cu + "\n视频进度:" + expectPlayer2Delay + "\n差值:" + dif;
|
|
String text = "演奏进度:" + cu + "\n视频进度:" + expectPlayer2Delay + "\n差值:" + dif;
|
|
viewBinding.tvDelayText.setText(text);
|
|
viewBinding.tvDelayText.setText(text);
|
|
@@ -1104,6 +1105,9 @@ public class MusicHandleActivity_ extends BaseMVPActivity<AcMusicHandleLayoutBin
|
|
@Override
|
|
@Override
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
int id = v.getId();
|
|
int id = v.getId();
|
|
|
|
+ if(UiUtils.isFastClick(300)){
|
|
|
|
+ return ;
|
|
|
|
+ }
|
|
if (id == R.id.iv_play) {
|
|
if (id == R.id.iv_play) {
|
|
if (isPlaying()) {
|
|
if (isPlaying()) {
|
|
pausePlay();
|
|
pausePlay();
|
|
@@ -1125,10 +1129,22 @@ public class MusicHandleActivity_ extends BaseMVPActivity<AcMusicHandleLayoutBin
|
|
private void resumePlay() {
|
|
private void resumePlay() {
|
|
getAudioPlayer().resume();
|
|
getAudioPlayer().resume();
|
|
if (player2 != null) {
|
|
if (player2 != null) {
|
|
|
|
+ aligningVideoPlayer();
|
|
player2.resume();
|
|
player2.resume();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 对齐一次视频播放器
|
|
|
|
+ */
|
|
|
|
+ private void aligningVideoPlayer(){
|
|
|
|
+ long cu = getAudioPlayer().getPlayProgress();
|
|
|
|
+ int seekResult2 = countAccompanyPosition(cu);
|
|
|
|
+ LOG.i("pq", "seekResult2:" + seekResult2);
|
|
|
|
+ player2.seekTo(seekResult2);
|
|
|
|
+ }
|
|
|
|
+
|
|
private boolean isPlaying() {
|
|
private boolean isPlaying() {
|
|
boolean playing = getAudioPlayer().isPlaying();
|
|
boolean playing = getAudioPlayer().isPlaying();
|
|
return playing;
|
|
return playing;
|
|
@@ -1141,7 +1157,7 @@ public class MusicHandleActivity_ extends BaseMVPActivity<AcMusicHandleLayoutBin
|
|
}
|
|
}
|
|
|
|
|
|
private void pausePlay() {
|
|
private void pausePlay() {
|
|
- if (player2.isPlaying()) {
|
|
|
|
|
|
+ if (player2 != null) {
|
|
player2.pause();
|
|
player2.pause();
|
|
}
|
|
}
|
|
getAudioPlayer().pause();
|
|
getAudioPlayer().pause();
|