Skip to content

Commit

Permalink
Added seekbar to the .avi and other files.
Browse files Browse the repository at this point in the history
Improved indentation.
  • Loading branch information
octacode committed Jul 16, 2017
1 parent c94ae8b commit 84e1f61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ dependencies {
androidTestCompile 'com.android.support:support-annotations:25.3.1'
provided 'com.squareup.dagger:dagger-compiler:1.2.5'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.14'
}

task generateWrapper(type: Wrapper) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@

import javax.inject.Inject;

import wseemann.media.FFmpegMediaMetadataRetriever;


public class TvPlaybackVideoFragment extends PlaybackFragment {

Expand Down Expand Up @@ -92,11 +94,10 @@ public void onCreate(Bundle savedInstanceState) {
}

private void setDuration() {
android.media.MediaPlayer mediaPlayer = android.media.MediaPlayer.create(getActivity(), getFileUri());
if(mediaPlayer!=null) {
mDuration = mediaPlayer.getDuration();
mediaPlayer.release();
}
FFmpegMediaMetadataRetriever mFFmpegMediaMetadataRetriever = new FFmpegMediaMetadataRetriever();
mFFmpegMediaMetadataRetriever.setDataSource(getFileUri().toString());
String mVideoDuration = mFFmpegMediaMetadataRetriever.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_DURATION);
mDuration = Integer.parseInt(mVideoDuration);
}

private void playVideo() {
Expand Down

0 comments on commit 84e1f61

Please sign in to comment.