GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mklimek/frame-video-view: Less issues with VideoView

BranchesTags
Open more actions menu

Latest commit

 

History

74 Commits
74 Commits

Folders and files

NameName
Last commit message
Last commit date
gradle/wrapper
gradle/wrapper
 
 
library
library
 
 
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

frame-viedo-view

Have you got any display issues using VideoView?
I had too. I wrote a blog post where you can find more details about these issues and how I solved them.

How it works?

FrameVideoView solves flickering and black screen issues by showing placeholder on the proper time.
Placeholder is a simple View on top of the VideoView. Placeholder is visisble just after onPause is called and invisible when onResume is called.
It allows to hide VideoView during screen transitions which causes strange issues. 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'
	}

Current $RELEASE_VERSION is

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(MediaPlayer mediaPlayer) {
          mediaPlayer.start();
      }
      
      @Override
      void mediaPlayerPrepareFailed(MediaPlayer mediaPlayer, String error){
      }
});

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

See example for more details.

About

Less issues with VideoView

Resources

Readme
License
Activity

Stars

64 stars

Watchers

3 watching

Forks

17 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.