Ejemplo n.º 1
0
  public void setMediaUri(com.intel.inde.mp.Uri uri) {
    int visibility = (uri == null) ? View.INVISIBLE : View.VISIBLE;

    if (mEnableSegmentPicker) {
      mSegmentSelector.setVisibility(visibility);
    }

    mDeleteButton.setVisibility(visibility);
    mTitleText.setVisibility(visibility);
    mDurationText.setVisibility(visibility);
    mVideoView.setVisibility(visibility);

    if (uri == null) {
      mediaFileName = null;

      mVideoDuration = 0;
      mVideoPosition = 0;

      postInvalidate();

      return;
    }

    try {
      mMediaInfo.setUri(uri);
    } catch (Exception ex) {
      throw new IllegalArgumentException("Unsupported media file format");
    }

    mVideoDuration = mMediaInfo.getDurationInMicroSec();
    mVideoPosition = (mVideoDuration / 2);

    mVideoView.setVideoURI(Uri.parse(uri.getString()));

    String duration = Format.duration(mVideoDuration / 1000);

    mTitleText.setText(mediaFileName);
    mDurationText.setText(duration);

    mSegmentSelector.setStartPosition(0);
    mSegmentSelector.setEndPosition(100);

    showPreview(10);
  }
Ejemplo n.º 2
0
 @Override
 public void onEndPositionChanged(int position) {
   showPreview(position);
 }