├── libPlayer ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── cn │ │ │ └── bfy │ │ │ └── player │ │ │ └── view │ │ │ ├── OnChangeListener.java │ │ │ └── MediaPlayerController.java │ ├── vlc │ │ └── res │ │ │ └── values │ │ │ └── vlc_strings.xml │ └── opengl │ │ ├── res │ │ └── raw │ │ │ ├── video_normal_fragment_shader.glsl │ │ │ └── video_vertex_shader.glsl │ │ └── java │ │ └── cn │ │ └── bfy │ │ └── player │ │ └── utils │ │ ├── TextResourceReader.java │ │ └── CameraUtil.java ├── upload_bintray.gradle ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── .gitignore ├── app ├── .gitignore ├── libs │ ├── media_player_sdk-1.2.0-debug.jar │ └── media_player_sdk-1.2.0-release.jar ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── about_ic.png │ │ │ ├── ic_about.png │ │ │ ├── ic_lock.png │ │ │ ├── ic_locked.png │ │ │ ├── ic_launcher.png │ │ │ ├── ic_settings.png │ │ │ ├── ic_pause_normal_w.png │ │ │ ├── ic_pause_pressed_w.png │ │ │ ├── ic_play_normal_w.png │ │ │ ├── ic_play_pressed_w.png │ │ │ ├── ic_backward_normal_w.png │ │ │ ├── ic_forward_normal_w.png │ │ │ ├── ic_forward_pressed_w.png │ │ │ ├── seekbar_thumb_normal.png │ │ │ ├── ic_backward_pressed_w.png │ │ │ ├── ic_crop_circle_normal.png │ │ │ ├── ic_crop_circle_pressed.png │ │ │ └── seekbar_thumb_pressed.png │ │ ├── drawable-mdpi │ │ │ ├── ic_about.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_settings.png │ │ ├── drawable-ldpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_settings.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── raw │ │ │ ├── video_normal_fragment_shader.glsl │ │ │ └── video_vertex_shader.glsl │ │ ├── drawable │ │ │ ├── ic_toggle_play.xml │ │ │ ├── radio_bg.xml │ │ │ ├── dialog_bg.xml │ │ │ ├── seekbar_thumb.xml │ │ │ ├── ic_play.xml │ │ │ ├── ic_pause.xml │ │ │ ├── ic_forward_w.xml │ │ │ ├── ic_backward_w.xml │ │ │ └── seekbar_style.xml │ │ ├── layout │ │ │ ├── surface_default_layout.xml │ │ │ ├── surface_vlc_layout.xml │ │ │ ├── lv_movie_item.xml │ │ │ ├── activity_player_list.xml │ │ │ ├── settings_layout.xml │ │ │ ├── video_player_layout.xml │ │ │ ├── controller_layout.xml │ │ │ └── about_layout.xml │ │ ├── menu │ │ │ └── main.xml │ │ └── anim │ │ │ ├── operate_controler_open.xml │ │ │ └── operate_controler_close.xml │ │ ├── java │ │ └── com │ │ │ └── bfy │ │ │ └── movieplayerplus │ │ │ ├── volley │ │ │ ├── RedirectError.java │ │ │ ├── TimeoutError.java │ │ │ ├── ServerError.java │ │ │ ├── NoConnectionError.java │ │ │ ├── Network.java │ │ │ ├── NetworkError.java │ │ │ ├── ClientError.java │ │ │ ├── ResponseDelivery.java │ │ │ ├── RetryPolicy.java │ │ │ ├── InternalUtils.java │ │ │ ├── toolbox │ │ │ │ ├── HttpStack.java │ │ │ │ ├── PoolingByteArrayOutputStream.java │ │ │ │ ├── RequestFuture.java │ │ │ │ ├── Volley.java │ │ │ │ └── ByteArrayPool.java │ │ │ ├── VolleyError.java │ │ │ ├── AuthFailureError.java │ │ │ ├── NetworkResponse.java │ │ │ ├── Response.java │ │ │ ├── Cache.java │ │ │ ├── DefaultRetryPolicy.java │ │ │ └── ExecutorDelivery.java │ │ │ ├── http │ │ │ ├── base │ │ │ │ ├── LoadControler.java │ │ │ │ ├── LoadListener.java │ │ │ │ ├── MyHostnameVerifier.java │ │ │ │ └── MyX509TrustManager.java │ │ │ ├── AbsLoadControler.java │ │ │ ├── ByteArrayLoadControler.java │ │ │ ├── StringRequest.java │ │ │ └── ByteArrayRequest.java │ │ │ ├── event │ │ │ ├── base │ │ │ │ ├── EventCallback.java │ │ │ │ ├── EventReceiver.java │ │ │ │ ├── EventDispatcher.java │ │ │ │ ├── Subscription.java │ │ │ │ ├── EventAlreadySentException.java │ │ │ │ ├── EventDispatcherFactory.java │ │ │ │ ├── EventRegisterFactory.java │ │ │ │ ├── EventRegister.java │ │ │ │ ├── Interceptor.java │ │ │ │ ├── Scheduler.java │ │ │ │ ├── Schedulers.java │ │ │ │ ├── Unsubscribed.java │ │ │ │ ├── EventHandler.java │ │ │ │ ├── Platform.java │ │ │ │ ├── EventFactory.java │ │ │ │ ├── AndroidThreadPool.java │ │ │ │ ├── CacheThreadPool.java │ │ │ │ ├── AndroidScheduler.java │ │ │ │ └── CacheScheduler.java │ │ │ ├── ContentResultEventDispatcher.java │ │ │ ├── DefaultEventDispatcher.java │ │ │ ├── EventJsonObject.java │ │ │ └── ContextEventDispatcher.java │ │ │ ├── model │ │ │ ├── base │ │ │ │ ├── RequestAction.java │ │ │ │ ├── ValidateFilter.java │ │ │ │ ├── ModelFactory.java │ │ │ │ ├── BaseModel.java │ │ │ │ └── ModelFilter.java │ │ │ └── biz │ │ │ │ └── MainBiz.java │ │ │ ├── parameter │ │ │ └── RequestParameter.java │ │ │ ├── utils │ │ │ ├── Md5Coder.java │ │ │ ├── LogUtils.java │ │ │ ├── Constant.java │ │ │ ├── PermissionUtils.java │ │ │ └── PackageUtil.java │ │ │ ├── bean │ │ │ └── SearchInfo.java │ │ │ └── MyApplication.java │ │ └── AndroidManifest.xml └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── readme.txt ├── gradlew.bat ├── import-summary.txt └── gradlew /libPlayer/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':libPlayer' 2 | -------------------------------------------------------------------------------- /libPlayer/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | /build 7 | /captures -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | /.gradle 3 | /local.properties 4 | /.idea 5 | .DS_Store 6 | /build 7 | /captures -------------------------------------------------------------------------------- /libPlayer/src/vlc/res/values/vlc_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/libs/media_player_sdk-1.2.0-debug.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/libs/media_player_sdk-1.2.0-debug.jar -------------------------------------------------------------------------------- /app/libs/media_player_sdk-1.2.0-release.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/libs/media_player_sdk-1.2.0-release.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/about_ic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/about_ic.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_lock.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-mdpi/ic_about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_locked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_locked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-ldpi/ic_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-mdpi/ic_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_pause_normal_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_pause_normal_w.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_pause_pressed_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_pause_pressed_w.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_play_normal_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_play_normal_w.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_play_pressed_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_play_pressed_w.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_backward_normal_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_backward_normal_w.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_forward_normal_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_forward_normal_w.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_forward_pressed_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_forward_pressed_w.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/seekbar_thumb_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/seekbar_thumb_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_backward_pressed_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_backward_pressed_w.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_crop_circle_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_crop_circle_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_crop_circle_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/ic_crop_circle_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/seekbar_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoxiangtt/MoviePlayerPlus/HEAD/app/src/main/res/drawable-hdpi/seekbar_thumb_pressed.png -------------------------------------------------------------------------------- /libPlayer/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Jun 08 11:14:22 GMT+08:00 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/raw/video_normal_fragment_shader.glsl: -------------------------------------------------------------------------------- 1 | #extension GL_OES_EGL_image_external : require 2 | precision mediump float; 3 | varying vec2 textureCoordinate; 4 | uniform samplerExternalOES s_texture; 5 | 6 | void main() { 7 | gl_FragColor = texture2D( s_texture, textureCoordinate ); 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #ffffff 7 | -------------------------------------------------------------------------------- /libPlayer/src/opengl/res/raw/video_normal_fragment_shader.glsl: -------------------------------------------------------------------------------- 1 | #extension GL_OES_EGL_image_external : require 2 | precision mediump float; 3 | varying vec2 textureCoordinate; 4 | uniform samplerExternalOES s_texture; 5 | 6 | void main() { 7 | gl_FragColor = texture2D( s_texture, textureCoordinate ); 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_toggle_play.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/radio_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /libPlayer/src/main/java/cn/bfy/player/view/OnChangeListener.java: -------------------------------------------------------------------------------- 1 | package cn.bfy.player.view; 2 | 3 | public interface OnChangeListener { 4 | 5 | void onBufferChanged(float buffer); 6 | 7 | void onPositionChanged(long progress); 8 | 9 | void onPrepared(); 10 | 11 | void onError(); 12 | 13 | void onEnd(); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/raw/video_vertex_shader.glsl: -------------------------------------------------------------------------------- 1 | uniform mat4 uMVPMatrix; 2 | uniform mat4 uSTMatrix; 3 | attribute vec4 vPosition; 4 | attribute vec4 inputTextureCoordinate; 5 | varying vec2 textureCoordinate; 6 | 7 | void main() { 8 | textureCoordinate = (uSTMatrix * inputTextureCoordinate).xy; 9 | gl_Position = uMVPMatrix * vPosition; 10 | } 11 | -------------------------------------------------------------------------------- /libPlayer/src/opengl/res/raw/video_vertex_shader.glsl: -------------------------------------------------------------------------------- 1 | uniform mat4 uMVPMatrix; 2 | uniform mat4 uSTMatrix; 3 | attribute vec4 vPosition; 4 | attribute vec4 inputTextureCoordinate; 5 | varying vec2 textureCoordinate; 6 | 7 | void main() { 8 | textureCoordinate = (uSTMatrix * inputTextureCoordinate).xy; 9 | gl_Position = uMVPMatrix * vPosition; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /libPlayer/upload_bintray.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.novoda.bintray-release' 2 | 3 | publish { 4 | userOrg = 'haoxiangtt'//bintray.com用户名 5 | groupId = 'com.bfy'//jcenter上的路径 6 | artifactId = 'movie-player-plus'//项目名称 7 | publishVersion = '1.0.0'//版本号 8 | desc = 'this is a mediaplayer widget.'//描述,不重要 9 | website = 'https://github.com/haoxiangtt/MoviePlayerPlus'//网站,不重要;尽量模拟github上的地址,例如我这样的;当然你有地址最好了 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/RedirectError.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.volley; 2 | 3 | /** 4 | * Indicates that there was a redirection. 5 | */ 6 | public class RedirectError extends VolleyError { 7 | 8 | public RedirectError() { 9 | } 10 | 11 | public RedirectError(final Throwable cause) { 12 | super(cause); 13 | } 14 | 15 | public RedirectError(final NetworkResponse response) { 16 | super(response); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/seekbar_thumb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/http/base/LoadControler.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.http.base; 2 | 3 | 4 | /** 5 | *
 6 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 7 |  * @company    : XXXXXXXXXXXXXXXXX
 8 |  * @author     : OuyangJinfu
 9 |  * @e-mail     : jinfu123.-@163.com
10 |  * @createDate : 2017/4/13 0023
11 |  * @modifyDate : 2017/4/13 0023
12 |  * @version    : 1.0
13 |  * @desc       : LoadControler for Request
14 |  * 
15 | */ 16 | public interface LoadControler { 17 | void cancel(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/EventCallback.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/4/18
10 |  * @modifyDate : 2017/4/18
11 |  * version     : 1.0
12 |  * @desc       : 事件回调接口
13 |  * 
14 | */ 15 | 16 | public interface EventCallback { 17 | void call(EventBuilder.Event event); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/surface_default_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/surface_vlc_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_play.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_pause.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/EventReceiver.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/4/14 0014
10 |  * @modifyDate : 2017/4/14 0014
11 |  * @version    : 1.0
12 |  * @desc       : 接收者(接收器)
13 |  * 
14 | */ 15 | 16 | public interface EventReceiver { 17 | void onReceive(EventBuilder.Event event); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_forward_w.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_backward_w.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/EventDispatcher.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/4/18
10 |  * @modifyDate : 2017/4/18
11 |  * @version    : 1.0
12 |  * @desc       : 事件分发器接口
13 |  * 
14 | */ 15 | 16 | public interface EventDispatcher { 17 | String TAG = "Event"; 18 | Subscription dispatch(EventBuilder.Event event); 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/lv_movie_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/Subscription.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/6/28 0028
10 |  * @modifyDate : 2017/6/28 0028
11 |  * @version    : 1.0
12 |  * @desc       : 订阅接口,用于查看订阅情况
13 |  * 
14 | */ 15 | 16 | public interface Subscription { 17 | 18 | void unsubscribe(); 19 | 20 | boolean isUnsubscribed(); 21 | 22 | EventBuilder.Event getEvent(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/EventAlreadySentException.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/4/19
10 |  * @modifyDate : 2017/4/19
11 |  * @version     : 1.0
12 |  * @desc       : event对象不能重复发送多次,如果这样做了,就会抛出此异常
13 |  * 
14 | */ 15 | 16 | public class EventAlreadySentException extends RuntimeException { 17 | 18 | public EventAlreadySentException(String str){ 19 | super(str); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/EventDispatcherFactory.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/6/1 0001
10 |  * @modifyDate : 2017/6/1 0001
11 |  * @version    : 1.0
12 |  * @desc       : 事件分发工厂接口
13 |  * 
14 | */ 15 | 16 | public interface EventDispatcherFactory { 17 | 18 | /** 19 | * 将event分发至相应的分发器(Dispatcher) 20 | * @param event 21 | */ 22 | EventDispatcher getEventDispatcher(EventBuilder.Event event); 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/model/base/RequestAction.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.model.base; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 网络请求行为注解(可扩展) 11 | * 该注解主要保存此次请求的一些相关信息,比如请求行为代号或者请求错误代号等 12 | * @author ouyangjinfu 13 | * @data on 2016/5/27. 14 | */ 15 | @Inherited 16 | @Target(ElementType.METHOD) 17 | @Retention(RetentionPolicy.RUNTIME) 18 | public @interface RequestAction { 19 | String action() default "";//请求行为代号 20 | String noNetWorkStatus() default "";//无网络状态代号 21 | String noNetWorkPrompt() default "";//无网络提示语 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/seekbar_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/http/base/LoadListener.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.http.base; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | *
 7 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 8 |  * @company    : XXXXXXXXXXXXXXXXX
 9 |  * @author     : OuyangJinfu
10 |  * @e-mail     : jinfu123.-@163.com
11 |  * @createDate : 2017/4/13 0023
12 |  * @modifyDate : 2017/4/13 0023
13 |  * @version    : 1.0
14 |  * @desc       : LoadListener special for ByteArrayLoadControler
15 |  * 
16 | */ 17 | public interface LoadListener { 18 | 19 | void onStart(); 20 | 21 | void onSuccess(byte[] data, Map headers, String url, String actionId); 22 | 23 | void onError(String errorCode, String errorMsg, String url, String actionId); 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/EventRegisterFactory.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/6/2 0002
10 |  * @modifyDate : 2017/6/2 0002
11 |  * @version    : 1.0
12 |  * @desc       :
13 |  * 
14 | */ 15 | 16 | public interface EventRegisterFactory { 17 | 18 | EventRegisterFactory registRegister(int type, EventRegister register); 19 | 20 | EventRegister getRegister(int type); 21 | 22 | EventRegisterFactory registDispatcher(int type, EventDispatcher dispatcher); 23 | 24 | EventDispatcher getDispatcher(int type); 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/EventRegister.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/6/2 0002
10 |  * @modifyDate : 2017/6/2 0002
11 |  * @version    : 1.0
12 |  * @desc       : 注册者(注册器),通常一个注册者管理多个接收者,需要通过一个标识来查找到对应的接收者;
13 |  *              有一种特殊情况就是如果一个注册者只管理一个接收者,那么EventRegister和EventReceiver接口可以在同一个类中实现
14 |  * 
15 | */ 16 | 17 | public interface EventRegister { 18 | /** 19 | * 获取接收者 20 | * @param key 注册者通过这个key来获取对应的接收者,这里的key对应event中的receiverKey参数 21 | * @return 22 | */ 23 | EventReceiver getReceiver(String key); 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/parameter/RequestParameter.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.parameter; 2 | 3 | 4 | import com.bfy.movieplayerplus.utils.Md5Coder; 5 | 6 | /** 7 | *
 8 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 9 |  * @company    : XXXXXXXXXXXXXXXXX
10 |  * @author     : OuyangJinfu
11 |  * @e-mail     : jinfu123.-@163.com
12 |  * @createDate : 2017/4/26 0026
13 |  * @modifyDate : 2017/4/26 0026
14 |  * @version    : 1.0
15 |  * @desc       : 请求参数基类
16 |  * 
17 | */ 18 | 19 | public abstract class RequestParameter { 20 | 21 | public abstract String toJsonString(); 22 | 23 | // public abstract String generateSign(String key); 24 | 25 | protected String generateMD5Sign(String str){ 26 | return Md5Coder.md5(str); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/Interceptor.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/6/29 0029
10 |  * @modifyDate : 2017/6/29 0029
11 |  * @version    : 1.0
12 |  * @desc       : 事件拦截器
13 |  * 
14 | */ 15 | public interface Interceptor { 16 | 17 | enum EventState {SEND, DISPATCH, SCHEDULE, BEGIN_WORKING, WORKING, CALLBACK, END_WORKING} 18 | 19 | /** 20 | * 拦截事件处理 21 | * @param state 拦截的阶段 22 | * @param event 拦截的事件源 23 | * @return 返回true表示拦截,直接中断事件传递,后续步骤不在执行;返回false表示不拦截,事件将继续传递 24 | */ 25 | boolean intercept(EventState state, EventBuilder.Event event); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/Scheduler.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | /** 6 | *
 7 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 8 |  * @company    : XXXXXXXXXXXXXXXXX
 9 |  * @author     : OuyangJinfu
10 |  * @e-mail     : jinfu123.-@163.com
11 |  * @createDate : 2017/6/28 0028
12 |  * @modifyDate : 2017/6/28 0028
13 |  * @version    : 1.0
14 |  * @desc       : Event调度器
15 |  * 
16 | */ 17 | public abstract class Scheduler { 18 | 19 | public static final String TAG = "Event"; 20 | 21 | public abstract Worker createWorker(Object... args); 22 | 23 | public abstract static class Worker{ 24 | 25 | public abstract Subscription schedule(); 26 | 27 | public abstract Subscription schedule(long delayTime, TimeUnit unit); 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/res/anim/operate_controler_open.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 16 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/anim/operate_controler_close.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/TimeoutError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.bfy.movieplayerplus.volley; 18 | 19 | /** 20 | * Indicates that the connection or the socket timed out. 21 | */ 22 | @SuppressWarnings("serial") 23 | public class TimeoutError extends VolleyError { } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/Schedulers.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/6/28 0028
10 |  * @modifyDate : 2017/6/28 0028
11 |  * @version    : 1.0
12 |  * @desc       : 调度器获取类
13 |  * 
14 | */ 15 | 16 | public class Schedulers { 17 | 18 | private static final Scheduler CACHE_SCHEDELER = new CacheScheduler(); 19 | 20 | private static final Scheduler UI_SCHEDELER = new AndroidScheduler(); 21 | 22 | public static Scheduler cache() { 23 | return CACHE_SCHEDELER; 24 | } 25 | 26 | public static Scheduler ui() { 27 | return UI_SCHEDELER; 28 | } 29 | 30 | public static Scheduler defaultScheduler() { 31 | return CACHE_SCHEDELER; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/model/base/ValidateFilter.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.model.base; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Inherited; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | /** 10 | * 过滤器注解,用于标记验证某些特殊操作 11 | * 比如需要验证token,在需要验证的方法上加入该注解,赋值type=Type.TOKEN 12 | * 若token与网络都要验证,则赋值type=Type.TOKEN | Type=NETWORK 13 | * @author ouyangjinfu 14 | * @data on 2016/5/27. 15 | */ 16 | @Inherited 17 | @Target(ElementType.METHOD) 18 | @Retention(RetentionPolicy.RUNTIME) 19 | public @interface ValidateFilter{ 20 | /** 21 | * 验证类型 22 | * 利用二进制位数记录各种验证类型,例如验证token为1,验证网络就为10, 23 | * 以此类推其他类型就为100、1000、10000等 24 | */ 25 | public class Type{ 26 | public static final int NETWORK = 1;//验证网络(1) 27 | } 28 | 29 | public int type() default 0; 30 | 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/http/base/MyHostnameVerifier.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.http.base; 2 | 3 | import javax.net.ssl.HostnameVerifier; 4 | import javax.net.ssl.SSLSession; 5 | 6 | /** 7 | *
 8 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 9 |  * @company    : XXXXXXXXXXXXXXXXX
10 |  * @author     : OuyangJinfu
11 |  * @e-mail     : jinfu123.-@163.com
12 |  * @createDate : 2017/4/13 0023
13 |  * @modifyDate : 2017/4/13 0023
14 |  * @version    : 1.0
15 |  * @desc       : MyHostnameVerifier.java
16 |  * 
17 | */ 18 | public class MyHostnameVerifier implements HostnameVerifier { 19 | 20 | @Override 21 | public boolean verify(String hostname, SSLSession session) { 22 | boolean result = false; 23 | // if (Constant.URL_BASE.contains("www.cmpassport.com")) { 24 | result = hostname.contains("www.cmpassport.com") || hostname.contains("open.mmarket.com"); 25 | // } 26 | return result; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | 视频播放器控件说明: 2 | 引入方式:compile 'com.bfy:movie-player-plus:1.0.0' 3 | 如果想使用vlc解码器还需导入一下依赖: 4 | compile 'de.mrmaffen:vlc-android-sdk:3.0.0' 5 | 6 | 混淆规则: 7 | -keep class org.videolan.libvlc.**{*;} 8 | 9 | 本项目集成了vlc和系统默认两种视频解码框架,分别进行了封装,主要封装的控件有4种: 10 | 使用vlc解码框架的: 11 | 1、VLCVideoView:使用surfaceView渲染视频; 12 | 2、GlVlcVideoView:使用GlSurfaceView渲染视频; 13 | 使用系统解码框架的: 14 | 1、VideoView:使用surfaceView渲染视频; 15 | 2、GlVideoView:使用GlSurfaceView渲染视频。 16 | 简单集成方式: 17 | 在layout布局文件中直接声明控件: 18 | 23 | 在代码中找到控件: 24 | MediaPlayerController player = (MediaPlayerController)findViewById(R.id.def_video); 25 | player.initPlayer(url);//初始化播放器 26 | player.start();//开始播放 27 | 28 | 作者:ouyangjinfu 29 | 注:该项目2019年起已经停止维护 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/ContentResultEventDispatcher.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event; 2 | 3 | import com.bfy.movieplayerplus.event.base.BaseEventDispatcher; 4 | import com.bfy.movieplayerplus.event.base.EventBuilder; 5 | import com.bfy.movieplayerplus.event.base.Subscription; 6 | 7 | /** 8 | *
 9 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
10 |  * @company    : XXXXXXXXXXXXXXXXX
11 |  * @author     : OuyangJinfu
12 |  * @e-mail     : jinfu123.-@163.com
13 |  * @createDate : 2017/6/2 0002
14 |  * @modifyDate : 2017/6/2 0002
15 |  * @version    : 1.0
16 |  * @desc       : 从本地数据库或者从内容提供者提取数据时用到的事件分发器,暂未实现。
17 |  * //TODO 待实现
18 |  * 
19 | */ 20 | 21 | public class ContentResultEventDispatcher extends BaseEventDispatcher { 22 | 23 | public ContentResultEventDispatcher() { 24 | 25 | } 26 | 27 | @Override 28 | public Subscription dispatch(EventBuilder.Event event) { 29 | return super.dispatch(event); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/base/Unsubscribed.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event.base; 2 | 3 | /** 4 | *
 5 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 6 |  * @company    : XXXXXXXXXXXXXXXXX
 7 |  * @author     : OuyangJinfu
 8 |  * @e-mail     : jinfu123.-@163.com
 9 |  * @createDate : 2017/6/28 0028
10 |  * @modifyDate : 2017/6/28 0028
11 |  * @version    : 1.0
12 |  * @desc       : 对订阅接口做空实现的被取消订阅的类。
13 |  * 
14 | */ 15 | 16 | public class Unsubscribed implements Subscription { 17 | 18 | private EventBuilder.Event mEvent; 19 | 20 | public Unsubscribed(){} 21 | 22 | public Unsubscribed(EventBuilder.Event event) { 23 | mEvent = event; 24 | } 25 | 26 | @Override 27 | public void unsubscribe() { 28 | 29 | } 30 | 31 | @Override 32 | public boolean isUnsubscribed() { 33 | return true; 34 | } 35 | 36 | @Override 37 | public EventBuilder.Event getEvent() { 38 | return mEvent; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/event/DefaultEventDispatcher.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.event; 2 | 3 | 4 | import com.bfy.movieplayerplus.event.base.BaseEventDispatcher; 5 | import com.bfy.movieplayerplus.event.base.EventBuilder; 6 | import com.bfy.movieplayerplus.event.base.Subscription; 7 | 8 | /** 9 | *
10 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
11 |  * @company    : XXXXXXXXXXXXXXXXX
12 |  * @author     : OuyangJinfu
13 |  * @e-mail     : jinfu123.-@163.com
14 |  * @createDate : 2017/4/18
15 |  * @modifyDate : 2017/4/18
16 |  * @version    : 2.0
17 |  * @desc       : 默认的事件分发器, 沿用BaseEventDispatcher逻辑, 暂为做实现
18 |  * //TODO 待实现
19 |  * 
20 | */ 21 | 22 | public class DefaultEventDispatcher extends BaseEventDispatcher { 23 | 24 | @Override 25 | public Subscription dispatch(EventBuilder.Event event) { 26 | return super.dispatch(event); 27 | } 28 | 29 | @Override 30 | protected Subscription onSchedule(EventBuilder.Event event) { 31 | return super.onSchedule(event); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /libPlayer/src/main/java/cn/bfy/player/view/MediaPlayerController.java: -------------------------------------------------------------------------------- 1 | package cn.bfy.player.view; 2 | 3 | import android.net.Uri; 4 | 5 | import java.util.ArrayList; 6 | 7 | public interface MediaPlayerController { 8 | 9 | //flag 10 | int SCREEN_FULL = 0; 11 | int SCREEN_DEFAULT = 1; 12 | 13 | //mode 14 | int SCALE_MODE_DEFAULT = 0; 15 | int SCALE_MODE_16_9 = 1; 16 | int SCALE_MODE_4_3 = 2; 17 | int SCALE_MODE_FULL = 3; 18 | 19 | boolean canSeekble(); 20 | void initPlayer(String url); 21 | void initPlayer(Uri uri); 22 | void initPlayer(ArrayList list); 23 | void initPlayer(ArrayList list,int index); 24 | void start(); 25 | void play(); 26 | void pause(); 27 | void stop(); 28 | void destroy(); 29 | boolean playNext(); 30 | boolean playBack(); 31 | void setTime(long time); 32 | long getTime(); 33 | long getDuration(); 34 | boolean isPlaying(); 35 | void seekTo(int delta); 36 | String getCurrentPlayUrl(); 37 | int getCurrentPlayIndex(); 38 | void setOnChangeListener(OnChangeListener listener); 39 | void setVideoScale(int flag,int scalMode); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/http/AbsLoadControler.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.http; 2 | 3 | import com.bfy.movieplayerplus.http.base.LoadControler; 4 | import com.bfy.movieplayerplus.volley.Request; 5 | 6 | /** 7 | *
 8 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 9 |  * @company    : XXXXXXXXXXXXXXXXX
10 |  * @author     : OuyangJinfu
11 |  * @e-mail     : jinfu123.-@163.com
12 |  * @createDate : 2017/4/13 0023
13 |  * @modifyDate : 2017/4/13 0023
14 |  * @version    : 1.0
15 |  * @desc       : Abstract LoaderControler that implements LoadControler
16 |  * 
17 | */ 18 | public abstract class AbsLoadControler implements LoadControler { 19 | 20 | protected Request mRequest; 21 | 22 | public void bindRequest(Request request) { 23 | this.mRequest = request; 24 | } 25 | 26 | @Override 27 | public void cancel() { 28 | if (this.mRequest != null) { 29 | this.mRequest.cancel(); 30 | } 31 | } 32 | 33 | protected String getUrl() { 34 | return this.mRequest.getUrl(); 35 | } 36 | } -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | BFY视频 5 | 播放器 6 | 关 于 7 | 没有视频资源! 8 | 已经到头了! 9 | 正在缓冲..%1$s 10 | 播放出错! 11 | 00:00:00 12 | 提示 13 | 是否从记录点开始播放? 14 | 15 | 16 | 确定 17 | 取消 18 | 播放器Demo 19 | 设置 20 | Hello world! 21 | 22 | 设置 23 | 解码器: 24 | 默认 25 | VLC 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/http/base/MyX509TrustManager.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.http.base; 2 | 3 | import javax.net.ssl.X509TrustManager; 4 | 5 | /** 6 | *
 7 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
 8 |  * @company    : XXXXXXXXXXXXXXXXX
 9 |  * @author     : OuyangJinfu
10 |  * @e-mail     : jinfu123.-@163.com
11 |  * @createDate : 2017/4/13 0023
12 |  * @modifyDate : 2017/4/13 0023
13 |  * @version    : 1.0
14 |  * @desc       :
15 |  * 
16 | */ 17 | public class MyX509TrustManager implements X509TrustManager { 18 | 19 | @Override 20 | public java.security.cert.X509Certificate[] getAcceptedIssuers() { 21 | return null; 22 | } 23 | 24 | @Override 25 | public void checkClientTrusted( 26 | java.security.cert.X509Certificate[] chain, String authType) 27 | throws java.security.cert.CertificateException { 28 | } 29 | 30 | @Override 31 | public void checkServerTrusted( 32 | java.security.cert.X509Certificate[] chain, String authType) 33 | throws java.security.cert.CertificateException { 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/ServerError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.bfy.movieplayerplus.volley; 18 | 19 | /** 20 | * Indicates that the server responded with an error response. 21 | */ 22 | @SuppressWarnings("serial") 23 | public class ServerError extends VolleyError { 24 | public ServerError(NetworkResponse networkResponse) { 25 | super(networkResponse); 26 | } 27 | 28 | public ServerError() { 29 | super(); 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/NoConnectionError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.bfy.movieplayerplus.volley; 18 | 19 | /** 20 | * Error indicating that no connection could be established when performing a Volley request. 21 | */ 22 | @SuppressWarnings("serial") 23 | public class NoConnectionError extends NetworkError { 24 | public NoConnectionError() { 25 | super(); 26 | } 27 | 28 | public NoConnectionError(Throwable reason) { 29 | super(reason); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/Network.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.bfy.movieplayerplus.volley; 18 | 19 | /** 20 | * An interface for performing requests. 21 | */ 22 | public interface Network { 23 | /** 24 | * Performs the specified request. 25 | * @param request Request to process 26 | * @return A {@link NetworkResponse} with data and caching metadata; will never be null 27 | * @throws VolleyError on errors 28 | */ 29 | public NetworkResponse performRequest(Request request) throws VolleyError; 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/model/biz/MainBiz.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.model.biz; 2 | 3 | import com.bfy.movieplayerplus.event.base.EventBuilder; 4 | import com.bfy.movieplayerplus.model.base.RequestAction; 5 | import com.bfy.movieplayerplus.model.base.ValidateFilter; 6 | import com.bfy.movieplayerplus.utils.Constant; 7 | 8 | /** 9 | *
10 |  * @copyright  : Copyright ©2004-2018 版权所有 XXXXXXXXXXXXXXXXX
11 |  * @company    : XXXXXXXXXXXXXXXXX
12 |  * @author     : OuyangJinfu
13 |  * @e-mail     : jinfu123.-@163.com
14 |  * @createDate : 2017/4/20
15 |  * @modifyDate : 2017/4/20
16 |  * version     : 1.0
17 |  * @desc       :
18 |  * 
19 | */ 20 | 21 | public interface MainBiz { 22 | 23 | @ValidateFilter(type = ValidateFilter.Type.NETWORK) 24 | @RequestAction(action = "102101",noNetWorkStatus = Constant.ResponseCode.CODE_NO_NETWORK, 25 | noNetWorkPrompt = "哎呀!网络有问题,请求失败,重试看看。") 26 | void getMV(EventBuilder.Event ev); 27 | 28 | @ValidateFilter(type = ValidateFilter.Type.NETWORK) 29 | @RequestAction(action = "102102",noNetWorkStatus = Constant.ResponseCode.CODE_NO_NETWORK, 30 | noNetWorkPrompt = "哎呀!网络有问题,请求失败,重试看看。") 31 | void getMVUrl(EventBuilder.Event ev); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/NetworkError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.bfy.movieplayerplus.volley; 18 | 19 | /** 20 | * Indicates that there was a network error when performing a Volley request. 21 | */ 22 | @SuppressWarnings("serial") 23 | public class NetworkError extends VolleyError { 24 | public NetworkError() { 25 | super(); 26 | } 27 | 28 | public NetworkError(Throwable cause) { 29 | super(cause); 30 | } 31 | 32 | public NetworkError(NetworkResponse networkResponse) { 33 | super(networkResponse); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/ClientError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.bfy.movieplayerplus.volley; 18 | 19 | /** 20 | * Indicates that the server responded with an error response indicating that the client has erred. 21 | * 22 | * For backwards compatibility, extends ServerError which used to be thrown for all server errors, 23 | * including 4xx error codes indicating a client error. 24 | */ 25 | @SuppressWarnings("serial") 26 | public class ClientError extends ServerError { 27 | public ClientError(NetworkResponse networkResponse) { 28 | super(networkResponse); 29 | } 30 | 31 | public ClientError() { 32 | super(); 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/utils/Md5Coder.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.utils; 2 | 3 | import java.security.NoSuchAlgorithmException; 4 | 5 | /** 6 | * Title: XXXX (类或者接口名称) 7 | * Description: XXXX (简单对此类或接口的名字进行描述) 8 | * Copyright: Copyright (c) 2012 9 | * Company:XXXXXXXXXXXXXXXXX 10 | * 11 | * @author duminghui 12 | * @version 1.0 13 | */ 14 | public class Md5Coder { 15 | 16 | public final static String md5(String src) { 17 | java.security.MessageDigest md; 18 | try { 19 | md = java.security.MessageDigest.getInstance("MD5"); 20 | byte[] bytes = src.getBytes(); 21 | byte[] bytes_md5 = md.digest(bytes); 22 | StringBuffer md5StrBuff = new StringBuffer(); 23 | 24 | for (int i = 0; i < bytes_md5.length; i++) { 25 | if (Integer.toHexString(0xFF & bytes_md5[i]).length() == 1) 26 | md5StrBuff.append("0").append( 27 | Integer.toHexString(0xFF & bytes_md5[i])); 28 | else 29 | md5StrBuff.append(Integer.toHexString(0xFF & bytes_md5[i])); 30 | } 31 | return md5StrBuff.toString(); 32 | } catch (NoSuchAlgorithmException e) { 33 | e.printStackTrace(); 34 | } 35 | return null; 36 | } 37 | 38 | public final static String md5Upper(String src) { 39 | return md5(src).toUpperCase(); 40 | } 41 | 42 | public final static String md5Lower(String src) { 43 | return md5(src).toLowerCase(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/utils/LogUtils.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.utils; 2 | 3 | import android.util.Log; 4 | 5 | import com.bfy.movieplayerplus.BuildConfig; 6 | 7 | 8 | public class LogUtils { 9 | public static boolean isDebug = BuildConfig.DEBUG; 10 | public static final LogUtils instance = new LogUtils(); 11 | 12 | public static LogUtils getInstance() { 13 | return instance; 14 | } 15 | 16 | public static void setDebugMode(boolean isDebug) { 17 | LogUtils.isDebug = isDebug; 18 | } 19 | 20 | public static final void e(String tag, String msg) { 21 | if (isDebug) 22 | Log.e(tag, msg); 23 | } 24 | 25 | public static final void w(String tag, String msg) { 26 | if (isDebug) 27 | Log.w(tag, msg); 28 | } 29 | 30 | public static final void d(String tag, String msg) { 31 | if (isDebug) 32 | Log.d(tag, msg); 33 | } 34 | 35 | public static final void i(String tag, String msg) { 36 | if (isDebug) 37 | Log.i(tag, msg); 38 | } 39 | 40 | public static final void v(String tag, String msg) { 41 | if (isDebug) 42 | Log.v(tag, msg); 43 | } 44 | 45 | public static final void debug(String tag, String msg) { 46 | if (isDebug) 47 | Log.d("outer", "[" + tag + "] : " + msg); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/ResponseDelivery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.bfy.movieplayerplus.volley; 18 | 19 | public interface ResponseDelivery { 20 | /** 21 | * Parses a response from the network or cache and delivers it. 22 | */ 23 | public void postResponse(Request request, Response response); 24 | 25 | /** 26 | * Parses a response from the network or cache and delivers it. The provided 27 | * Runnable will be executed after delivery. 28 | */ 29 | public void postResponse(Request request, Response response, Runnable runnable); 30 | 31 | /** 32 | * Posts an error for the given request. 33 | */ 34 | public void postError(Request request, VolleyError error); 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/RetryPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.bfy.movieplayerplus.volley; 18 | 19 | /** 20 | * Retry policy for a request. 21 | */ 22 | public interface RetryPolicy { 23 | 24 | /** 25 | * Returns the current timeout (used for logging). 26 | */ 27 | public int getCurrentTimeout(); 28 | 29 | /** 30 | * Returns the current retry count (used for logging). 31 | */ 32 | public int getCurrentRetryCount(); 33 | 34 | /** 35 | * Prepares for the next retry by applying a backoff to the timeout. 36 | * @param error The error code of the last attempt. 37 | * @throws VolleyError In the event that the retry could not be performed (for example if we 38 | * ran out of attempts), the passed in error is thrown. 39 | */ 40 | public void retry(VolleyError error) throws VolleyError; 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/InternalUtils.java: -------------------------------------------------------------------------------- 1 | package com.bfy.movieplayerplus.volley; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import java.security.MessageDigest; 5 | import java.security.NoSuchAlgorithmException; 6 | 7 | /** 8 | * User: mcxiaoke 9 | * Date: 15/3/17 10 | * Time: 14:47 11 | */ 12 | class InternalUtils { 13 | 14 | // http://stackoverflow.com/questions/9655181/convert-from-byte-array-to-hex-string-in-java 15 | private final static char[] HEX_CHARS = "0123456789ABCDEF".toCharArray(); 16 | 17 | private static String convertToHex(byte[] bytes) { 18 | char[] hexChars = new char[bytes.length * 2]; 19 | for (int j = 0; j < bytes.length; j++) { 20 | int v = bytes[j] & 0xFF; 21 | hexChars[j * 2] = HEX_CHARS[v >>> 4]; 22 | hexChars[j * 2 + 1] = HEX_CHARS[v & 0x0F]; 23 | } 24 | return new String(hexChars); 25 | } 26 | 27 | public static String sha1Hash(String text) { 28 | String hash = null; 29 | try { 30 | final MessageDigest digest = MessageDigest.getInstance("SHA-1"); 31 | final byte[] bytes = text.getBytes("UTF-8"); 32 | digest.update(bytes, 0, bytes.length); 33 | hash = convertToHex(digest.digest()); 34 | } catch (NoSuchAlgorithmException e) { 35 | e.printStackTrace(); 36 | } catch (UnsupportedEncodingException e) { 37 | e.printStackTrace(); 38 | } 39 | return hash; 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /libPlayer/src/opengl/java/cn/bfy/player/utils/TextResourceReader.java: -------------------------------------------------------------------------------- 1 | package cn.bfy.player.utils; 2 | 3 | import android.content.Context; 4 | import android.content.res.Resources; 5 | 6 | import java.io.BufferedReader; 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | import java.io.InputStreamReader; 10 | 11 | /** 12 | * @author liyachao 296777513 13 | * @version 1.0 14 | * date 2017/3/1 15 | */ 16 | public class TextResourceReader { 17 | /** 18 | * Reads in text from a resource file and returns a String containing the 19 | * text. 20 | */ 21 | public static String readTextFileFromResource(Context context, int resourceId) { 22 | StringBuilder body = new StringBuilder(); 23 | 24 | try { 25 | InputStream inputStream = context.getResources().openRawResource(resourceId); 26 | InputStreamReader inputStreamReader = new InputStreamReader(inputStream); 27 | BufferedReader bufferedReader = new BufferedReader(inputStreamReader); 28 | 29 | String nextLine; 30 | 31 | while ((nextLine = bufferedReader.readLine()) != null) { 32 | body.append(nextLine); 33 | body.append('\n'); 34 | } 35 | } catch (IOException e) { 36 | throw new RuntimeException("Could not open resource: " + resourceId, e); 37 | } catch (Resources.NotFoundException nfe) { 38 | throw new RuntimeException("Resource not found: " + resourceId, nfe); 39 | } 40 | 41 | return body.toString(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/bfy/movieplayerplus/volley/toolbox/HttpStack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.bfy.movieplayerplus.volley.toolbox; 18 | 19 | import org.apache.http.HttpResponse; 20 | 21 | import java.io.IOException; 22 | import java.util.Map; 23 | 24 | import com.bfy.movieplayerplus.volley.AuthFailureError; 25 | import com.bfy.movieplayerplus.volley.Request; 26 | 27 | /** 28 | * An HTTP stack abstraction. 29 | */ 30 | public interface HttpStack { 31 | /** 32 | * Performs an HTTP request with the given parameters. 33 | * 34 | *

A GET request is sent if request.getPostBody() == null. A POST request is sent otherwise, 35 | * and the Content-Type header is set to request.getPostBodyContentType().

36 | * 37 | * @param request the request to perform 38 | * @param additionalHeaders additional headers to be sent together with 39 | * {@link Request#getHeaders()} 40 | * @return the HTTP response 41 | */ 42 | public HttpResponse performRequest(Request request, Map additionalHeaders) 43 | throws IOException, AuthFailureError; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_player_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 13 | 19 | 20 | 26 | 32 |