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 - henryblue/MxVideoPlayer: A simple video player support mobile and TV

BranchesTags
Open more actions menu

Latest commit

 

History

71 Commits
71 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
xvideoplayer
xvideoplayer
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Tvscreenshot.png
Tvscreenshot.png
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
screenshot1.jpg
screenshot1.jpg
 
 
screenshot2.jpg
screenshot2.jpg
 
 
screenshot3.jpg
screenshot3.jpg
 
 
screenshot4.jpg
screenshot4.jpg
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

MxVideoPlayer

A simple video player support mobile and TV. Video playback base on ijkplayer. The player supports more video formats by default.

ScreenShot

   

   

Usage

First you can add gradle dependency with command :

defaultConfig {
   ......
   minSdkVersion 16  // at least 16
   ......
   }
dependencies {
    ......
    compile 'com.henryblue.mxvideoplayer:xvideoplayer:1.2.1'
   }

To add gradle dependency you need to open build.gradle (in your app folder,not in a project folder) then copy and add the dependencies there in the dependencies block.

MxVideoPlayer default only support 'armeabi-v7a' CPU style. If you want to support more CPU types, you can choose version 1.1.6, which supports 'armeabi', 'armeabi-v7a', 'arm64-v8a' 'x86' and 'x86_64', but it will make your project Larger, you can configure the type of CPU you need in your project. The configuration is as follows:

android {
    ........
    
    defaultConfig {
        ........
        
        ndk {
            // config you want to support device
            abiFilters 'arm64-v8a', 'armeabi', 'armeabi-v7a', 'x86'
        }
    }
}

Use in mobile

  1. Add to layout
    <hb.xvideoplayer.MxVideoPlayerWidget
        android:id="@+id/mpw_video_player"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
  1. set play url and start video
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        .......
        MxVideoPlayerWidget videoPlayerWidget = (MxVideoPlayerWidget) findViewById(R.id.mpw_video_player);
        videoPlayerWidget.startPlay("play url", MxVideoPlayer.SCREEN_LAYOUT_NORMAL, "video name");
        .......
    }
         
    @Override
    protected void onPause() {
        super.onPause();
        MxVideoPlayer.releaseAllVideos();
    }

    @Override
    public void onBackPressed() {
        if (MxVideoPlayer.backPress()) {
            return;
        }
        super.onBackPressed();
    }

if you want auto fullscreen, you can do that:

    MxVideoPlayerWidget.startFullscreen(this, MxVideoPlayerWidget.class, "video url", "video name");

Usage in TV

  1. Add to layout
    <hb.xvideoplayer.MxTvPlayerWidget
        android:id="@+id/mpw_video_player"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
  1. set play url and start video
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        ........
        mVideoPlayerWidget = (MxTvPlayerWidget) findViewById(R.id.mpw_video_player);
        mVideoPlayerWidget.startPlay("video url", "video name");
        ........
    }


    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        return mVideoPlayerWidget.requestKeyDown(keyCode, event);
    }

    @Override
    public boolean onKeyUp(int keyCode, KeyEvent event) {
        return mVideoPlayerWidget.requestKeyUp(keyCode, event);
    }

    @Override
    protected void onPause() {
        super.onPause();
        MxVideoPlayer.releaseAllVideos();
    }

MxTvPlayerWidget handle Key event including KEYCODE_VOLUME_DOWN, KEYCODE_VOLUME_UP, KEYCODE_DPAD_UP, KEYCODE_DPAD_DOWN, KEYCODE_DPAD_RIGHT, KEYCODE_DPAD_LEFT, KEYCODE_BACK and KEYCODE_ENTER.

About

A simple video player support mobile and TV

Topics

playerviewtvvideo-player

Resources

Readme
Apache-2.0 license
Activity

Stars

128 stars

Watchers

6 watching

Forks

45 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — 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.