List of usage examples for android.media MediaMetadata getLong
public long getLong(@LongKey String key)
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(); }