Skip to content

Commit

Permalink
Merge pull request #10 from m-kubis/mediaplayer_prepare_failure_handling
Browse files Browse the repository at this point in the history
Mediaplayer prepare failure handling
  • Loading branch information
mklimek committed Jun 7, 2016
2 parents 316b4e3 + 7429ef6 commit f769958
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-alpha4'
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.github.dcendents.android-maven'

group='com.github.mklimek'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
buildToolsVersion "23.0.3"

defaultConfig {
minSdkVersion 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
import android.media.MediaPlayer;

public interface FrameVideoViewListener {
void mediaPlayerPrepared(MediaPlayer mediaPlayer);
void mediaPlayerPrepared( MediaPlayer mediaPlayer );

void mediaPlayerPrepareFailed( MediaPlayer mediaPlayer, String error );
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ private void prepare() {
mediaPlayer.setOnBufferingUpdateListener(this);
mediaPlayer.prepare();
} catch (Exception e) {
LOG.error("cannot prepare media player with SurfaceTexture", e);
if ( listener != null ) {
listener.mediaPlayerPrepareFailed( mediaPlayer, e.toString() );
}
removeVideo();
}
}

Expand Down

0 comments on commit f769958

Please sign in to comment.