Giter Site home page Giter Site logo

yt511652502 / yjplay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yangchaojiang/yjplay

0.0 2.0 0.0 7.51 MB

基于exoplay 自定义播放器 支持直播 1 ExoUserPlayer 基本播放器 2 GestureVideoPlayer 增加手势 亮度,音量,快进,等手势 3 ManualPlayer 默认手动播放,增加默认图 4 支持自定义ui

Java 100.00%

yjplay's Introduction

yjPlay

 

基于exoplay 自定义播放器 支持直播   1 ExoUserPlayer 基本播放器 2 GestureVideoPlayer 增加手势 亮度,音量,快进,等手势 3 ManualPlayer 默认手动播放,增加默认图 4 支持自定义ui

gif 显示有点卡,帧数低,实际很流畅

###Import

use import dependency in gradle  

 repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
    
dependencies {

   compile 'com.ycjiang:VideoPlayModule:1.2.1'

}

 Maven

<dependency>
  <groupId>com.ycjiang</groupId>
  <artifactId>VideoPlayModule</artifactId>
  <version>1.2.1/version>
  <type>pom</type>
</dependency>

XML

   播放代码
   ManualPlayer exoPlayerManager = new ManualPlayer(this,getString(R.string.url_hls));
   布局引用
    <include layout="@layout/simple_exo_video_play"/>
    或者是
    播放代码
    ManualPlayer exoPlayerManager = new ManualPlayer(this,playView,getString(R.string.url_hls));  
    布局引用
      
      
   <com.google.android.exoplayer2.ui.SimpleExoPlayerView
            android:id="@+id/player_view"
            android:layout_width="match_parent"
            android:layout_height="200dp"
            app:controller_layout_id="@layout/simple_exo_playback_control_view"
            app:default_artwork="@mipmap/video_def"
            app:player_layout_id="@layout/simple_exo_player_view"
            app:resize_mode="fit"
            app:surface_type="texture_view"
            app:use_artwork="true" />
 
 
 
   @Override
    public void onStart() {
        super.onStart();
        exoPlayerManager.onStart();
        Log.d(TAG, "onStart");
    }

    @Override
    public void onResume() {
        super.onResume();
        Log.d(TAG, "onResume");
        exoPlayerManager.onResume();
    }

    @Override
    public void onPause() {
        super.onPause();
        Log.d(TAG, "onPause");
        exoPlayerManager.onPause();
    }

    @Override
    public void onStop() {
        super.onStop();
        exoPlayerManager.onStop();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        exoPlayerManager.onConfigurationChanged(newConfig);
    }

    @Override
    public void onBackPressed() {
        exoPlayerManager.onBackPressed();
    }

yjplay's People

Contributors

yangchaojiang avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.