Esempio n. 1
0
  @Override
  public void seekBarChange(int curPos) {
    // TODO Auto-generated method stub
    double curTime = curPos * videoDuration / seekWidth;
    if (curTime < startMontageTime) {
      curTime = startMontageTime;
      montageView.setCurTime(curTime);
    }

    Log.d(
        TAG,
        "seekBarChange in curTime = "
            + curTime
            + " curPos = "
            + curPos
            + " seekWidth = "
            + seekWidth);
    if (mMediaPlayer != null) {
      int status = mMediaPlayer.getStatus();
      if (status == XEffectMediaPlayer.STATUS_UNKNOW
          || status == XEffectMediaPlayer.STATUS_STOP
          || status == XEffectMediaPlayer.STATUS_OPENED) {
        mMediaPlayer.play();
        mMediaPlayer.pause();
        //				ivPlay.setImageResource(R.drawable.play);
        ivPlay.setVisibility(View.VISIBLE);
      }
      mMediaPlayer.seek(curTime);
      montageView.postInvalidate();
    }
  }
Esempio n. 2
0
 @Override
 public void seekBarCropUp(int thumb1Value, int thumb2Value) {
   // TODO Auto-generated method stub
   startMontageTime = calculateTime(thumb1Value);
   endMontageTime = calculateTime(thumb2Value);
   double laveLen = startMontageTime + (curVideoDuration - endMontageTime);
   if (laveLen < VideoMontageView.SHORTEST_TIME) {
     montageDelete.setEnabled(false);
   } else {
     montageDelete.setEnabled(true);
   }
   mMediaPlayer.seek(startMontageTime);
   montageView.setCurTime(startMontageTime);
   Log.d(
       TAG,
       "seekBarCropUp  thumb1Value = "
           + thumb1Value
           + " thumb2Value = "
           + thumb2Value
           + " startMontageTime = "
           + startMontageTime
           + " endMontageTime = "
           + endMontageTime
           + " laveLen = "
           + laveLen);
 }