Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

Commit

Permalink
fixed encoding/framerate error; fixed resume mediaplayer error;
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Feb 27, 2012
1 parent c31e3f8 commit d0e0b7d
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/org/witness/ssc/video/VideoEditor.java
Expand Up @@ -196,7 +196,18 @@ public void onCreate(Bundle savedInstanceState) {
mediaPlayer.setLooping(false);
mediaPlayer.setScreenOnWhilePlaying(true);


try {
mediaPlayer.setDataSource(originalVideoUri.toString());
} catch (IllegalArgumentException e) {
Log.v(LOGTAG, e.getMessage());
finish();
} catch (IllegalStateException e) {
Log.v(LOGTAG, e.getMessage());
finish();
} catch (IOException e) {
Log.v(LOGTAG, e.getMessage());
finish();
}

progressBar = (InOutPlayheadSeekBar) this.findViewById(R.id.InOutPlayheadSeekBar);

Expand Down Expand Up @@ -807,7 +818,7 @@ private void processVideo() {

mCancelled = false;

mediaPlayer.stop();
mediaPlayer.pause();
//mediaPlayer.release();

progressDialog = ProgressDialog.show(this, "", "Processing. Please wait...", true);
Expand Down Expand Up @@ -837,9 +848,9 @@ public void run ()
if (ffmpeg == null)
ffmpeg = new FFMPEGWrapper(VideoEditor.this.getBaseContext());

float sizeMult = .5f;
float sizeMult = .75f;
int frameRate = 15;
int bitRate = 250;
int bitRate = 300;
String format = "mp4";

ShellUtils.ShellCallback sc = new ShellUtils.ShellCallback ()
Expand Down Expand Up @@ -935,7 +946,7 @@ private void shareVideo() {

protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
showPlayShareDialog();

}

@Override
Expand Down Expand Up @@ -1051,18 +1062,6 @@ public void shellOut(char[] msg) {
protected void onResume() {
super.onResume();

try {
mediaPlayer.setDataSource(originalVideoUri.toString());
} catch (IllegalArgumentException e) {
Log.v(LOGTAG, e.getMessage());
finish();
} catch (IllegalStateException e) {
Log.v(LOGTAG, e.getMessage());
finish();
} catch (IOException e) {
Log.v(LOGTAG, e.getMessage());
finish();
}
}


Expand Down

0 comments on commit d0e0b7d

Please sign in to comment.