Skip to content

m-kubis/frame-video-view

 
 

Repository files navigation

frame-viedo-view

No more issues with VideoView.
Read more in blog post I wrote.

How it works?

FrameVideoView solved flickering and black screen issues by showing placeholder in proper time.
If your device is running API level 14 or higher it will use TextureView to increase video playback performance, otherwise VideoView will be used.

How to use it?

Step 1. Add it in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url "https://jitpack.io" }
		}
	}

Step 2. Add the dependency:

	dependencies {
	        compile 'com.github.mklimek:frame-video-view:$RELEASE_VERSION'
	}

Get $RELEASE_VERSION from here.

Step 3. Add view in xml:

<com.mklimek.frameviedoview.FrameVideoView
    android:id="@+id/frame_video_view"
    android:layout_width="@dimen/video_width"
    android:layout_height="@dimen/video_height"
  />

Step 4. Setup resource and FrameVideoViewListener:

frameVideoView = (FrameVideoView) findViewById(R.id.frameVideoView);
frameVideoView.setup(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.fb));
frameVideoView.setFrameVideoViewListener(new FrameVideoViewListener() {
      @Override
      public void mediaPlayerPrepared(final MediaPlayer mediaPlayer) {
          mediaPlayer.start();
      }
});

you can call pause, resume, looping and other methods available in MediaPlayer.

See example for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%