Java Code Examples for android.support.v4.media.MediaMetadataCompat#getLong()

The following examples show how to use android.support.v4.media.MediaMetadataCompat#getLong() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlayingNowList.java    From Bop with Apache License 2.0 5 votes vote down vote up
private void updateDuration(MediaMetadataCompat metadata) {
    if (metadata == null) {
        return;
    }
    int duration = (int) metadata.getLong(MediaMetadataCompat.METADATA_KEY_DURATION);
    Log.e("lol", String.valueOf(duration));
    seekArc.setMax(duration);
}
 
Example 2
Source File: PlayerView.java    From Bop with Apache License 2.0 5 votes vote down vote up
private void updateDuration(MediaMetadataCompat metadata) {
    if (metadata == null) {
        return;
    }
    int duration = (int) metadata.getLong(MediaMetadataCompat.METADATA_KEY_DURATION);
    mProgressView.setMax(duration);
}
 
Example 3
Source File: MainScreen.java    From Bop with Apache License 2.0 5 votes vote down vote up
private void updateDuration(MediaMetadataCompat metadata) {
    if (metadata == null) {
        return;
    }
    int duration = (int) metadata.getLong(MediaMetadataCompat.METADATA_KEY_DURATION);
    mProgressView.setMax(duration);
}
 
Example 4
Source File: TrackFragment.java    From Melophile with Apache License 2.0 5 votes vote down vote up
private void updateDuration(MediaMetadataCompat metadataCompat) {
  if (metadataCompat == null) return;
  int duration = (int) metadataCompat.getLong(MediaMetadataCompat.METADATA_KEY_DISC_NUMBER);
  startTime.setText(DateUtils.formatElapsedTime(duration / 1000));
  duration = (int) metadataCompat.getLong(MediaMetadataCompat.METADATA_KEY_DURATION);
  endTime.setText(DateUtils.formatElapsedTime(duration / 1000));
  progress.setMax(duration);
}
 
Example 5
Source File: PlaybackControlsFragment.java    From YouTube-In-Background with MIT License 5 votes vote down vote up
private void updateDuration(MediaMetadataCompat metadata)
    {
        if (metadata == null) return;
        if (lastPlaybackState.getState() != STATE_PAUSED) {
//            LogHelper.e(TAG, "updateDuration called ");
            int duration = (int) metadata.getLong(METADATA_KEY_DURATION);
            seekbar.setMax(duration);
            tvEnd.setText(DateUtils.formatElapsedTime(duration / 1000));
        }
    }
 
Example 6
Source File: FullScreenPlayerActivity.java    From LyricHere with Apache License 2.0 5 votes vote down vote up
private void updateDuration(MediaMetadataCompat metadata) {
    if (metadata == null) {
        return;
    }
    LogUtils.d(TAG, "updateDuration called ");
    int duration = (int) metadata.getLong(MediaMetadataCompat.METADATA_KEY_DURATION);
    mSeekBar.setMax(duration);
    mEnd.setText(Utils.formatMillis(duration));
}
 
Example 7
Source File: MediaSeekBar.java    From android-MediaBrowserService with Apache License 2.0 5 votes vote down vote up
@Override
public void onMetadataChanged(MediaMetadataCompat metadata) {
    super.onMetadataChanged(metadata);

    final int max = metadata != null
            ? (int) metadata.getLong(MediaMetadataCompat.METADATA_KEY_DURATION)
            : 0;
    setProgress(0);
    setMax(max);
}