Skip to content

Commit

Permalink
Merge pull request #89 from learning-layers/feature/long-tap-annotation
Browse files Browse the repository at this point in the history
Feature/long tap annotation
  • Loading branch information
melonmanchan committed Apr 26, 2016
2 parents 0db6bb0 + 46ca1c2 commit 5e0d542
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public final class PlayerFragment extends Fragment implements ExoPlayer.Listener
// Number of framework renderers (currently video and audio)
private static final int DOWNSTREAM_RENDERER_COUNT = 2;

// The total buffer size for storing video stream data, in bytes
private static final int EXO_BUFFER_SIZE = 1024 * 1024 * 8;

private State state = State.UNPREPARED;

private FrameLayout videoContainer;
Expand Down Expand Up @@ -185,7 +188,7 @@ public void prepare(Video video, AnnotationEditor annotationEditor) {

extractor = new Mp4Extractor();

ExtractorSampleSource source = new ExtractorSampleSource(videoUri, dataSource, extractor, DOWNSTREAM_RENDERER_COUNT, 5 * 1024 * 1024);
ExtractorSampleSource source = new ExtractorSampleSource(videoUri, dataSource, extractor, DOWNSTREAM_RENDERER_COUNT, EXO_BUFFER_SIZE);

// The video renderer runs on another thread: we need to supply a handler on the main
// thread in order to receive events.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,9 @@ private class GestureListener extends GestureDetector.SimpleOnGestureListener {
/**
* Called when the canvas is tapped once.
*/
@Override
public boolean onSingleTapUp(MotionEvent event) {
canvasTapped(event);
return true;
}

@Override
public boolean onDown(MotionEvent event) {
// Best practice to always return true here.
// http://developer.android.com/training/gestures/detector.html#detect
canvasTapped(event);
return true;
}

Expand Down

0 comments on commit 5e0d542

Please sign in to comment.