Example usage for android.media MediaMetadata getLong

List of usage examples for android.media MediaMetadata getLong

Introduction

In this page you can find the example usage for android.media MediaMetadata getLong.

Prototype

public long getLong(@LongKey String key) 

Source Link

Document

Returns the value associated with the given key, or 0L if no long exists for the given key.

Usage

From source file:de.kraenksoft.c3tv.ui.PlaybackOverlayFragment.java

private void updateMovieView(MediaMetadata metadata) {
    Video v = new Video.VideoBuilder().buildFromMediaDesc(metadata.getDescription());
    long dur = metadata.getLong(MediaMetadata.METADATA_KEY_DURATION);

    // PlaybackControlsRow doesn't allow you to set the item, so we must create a new one
    // because our Video class is now immutable.
    // TODO(ryanseys): Implement Playback Glue support so this can be mitigated.
    mPlaybackControlsRow = new PlaybackControlsRow(v);
    mPlaybackControlsRow.setTotalTime((int) dur);

    // Show the video card image if there is enough room in the UI for it.
    // If you have many primary actions, you may not have enough room.
    updateVideoImage(v.cardImageUrl);//ww w  .  j ava  2  s .c om

    mRowsAdapter.clear();
    mRowsAdapter.add(mPlaybackControlsRow);

    updatePlaybackRow();

    mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);
    mPlaybackControlsRow.setSecondaryActionsAdapter(mSecondaryActionsAdapter);

    addOtherRows();
}

From source file:org.mythtv.android.presentation.view.fragment.TvPlaybackOverlayFragment.java

private void updateMovieView(MediaMetadata metadata) {

    VideoModel v = new VideoModel.VideoModelBuilder().buildFromMediaDesc(metadata.getDescription());
    long dur = metadata.getLong(MediaMetadata.METADATA_KEY_DURATION);

    // PlaybackControlsRow doesn't allow you to set the item, so we must create a new one
    // because our Video class is now immutable.
    // TODO(ryanseys): Implement Playback Glue support so this can be mitigated.
    mPlaybackControlsRow = new PlaybackControlsRow(v);
    mPlaybackControlsRow.setTotalTime((int) dur);

    // Show the video card image if there is enough room in the UI for it.
    // If you have many primary actions, you may not have enough room.
    updateVideoImage(v.cardImageUrl);// w w w . j  a  v  a 2 s. co m

    mRowsAdapter.clear();
    mRowsAdapter.add(mPlaybackControlsRow);

    updatePlaybackRow();

    mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);
    mPlaybackControlsRow.setSecondaryActionsAdapter(mSecondaryActionsAdapter);

    addOtherRows();

}