├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── adapter_player.xml │ │ │ │ ├── activity_simple.xml │ │ │ │ ├── activity_list.xml │ │ │ │ └── activity_main.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── d │ │ │ │ └── commenplayer │ │ │ │ ├── App.java │ │ │ │ ├── model │ │ │ │ └── MediaModel.java │ │ │ │ ├── adapter │ │ │ │ ├── PlayerAdapter.java │ │ │ │ └── PlayerItem.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── activity │ │ │ │ ├── SimpleActivity.java │ │ │ │ └── ListActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── d │ │ │ └── commenplayer │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── d │ │ └── commenplayer │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── lib ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable-xhdpi │ │ │ │ ├── lib_player_ic_back.png │ │ │ │ ├── lib_player_ic_play.png │ │ │ │ ├── lib_player_ic_pause.png │ │ │ │ ├── lib_player_ic_volume.png │ │ │ │ ├── lib_player_ic_aplayer.png │ │ │ │ ├── lib_player_ic_backward.png │ │ │ │ ├── lib_player_ic_forward.png │ │ │ │ ├── lib_player_ic_loading.png │ │ │ │ ├── lib_player_ic_brightness.png │ │ │ │ ├── lib_player_ic_fullscreen_in.png │ │ │ │ └── lib_player_ic_fullscreen_out.png │ │ │ ├── drawable │ │ │ │ ├── lib_player_corner_bg_control.xml │ │ │ │ ├── lib_player_corner_bg_6.xml │ │ │ │ ├── lib_player_gradient_bg_top.xml │ │ │ │ ├── lib_player_gradient_bg_bottom.xml │ │ │ │ ├── lib_player_loading.xml │ │ │ │ ├── lib_player_seekbar_play_thumb.xml │ │ │ │ ├── lib_player_seekbar_adjust.xml │ │ │ │ └── lib_player_seekbar_play.xml │ │ │ ├── values-zh-rCN │ │ │ │ └── strings.xml │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── lib_player_layout_aplayer.xml │ │ │ │ ├── lib_player_layout_player.xml │ │ │ │ ├── lib_player_layout_touch.xml │ │ │ │ └── lib_player_layout_control.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── d │ │ │ │ └── lib │ │ │ │ └── commenplayer │ │ │ │ ├── listener │ │ │ │ ├── OnNetworkListener.java │ │ │ │ ├── OnAnimatorUpdateListener.java │ │ │ │ ├── OnShowThumbnailListener.java │ │ │ │ ├── IPlayerListener.java │ │ │ │ ├── IMediaPlayerControl.java │ │ │ │ └── IRenderView.java │ │ │ │ ├── util │ │ │ │ ├── FileMediaDataSource.java │ │ │ │ ├── Settings.java │ │ │ │ ├── MediaPlayerCompat.java │ │ │ │ ├── ULog.java │ │ │ │ ├── Factory.java │ │ │ │ ├── InfoHudViewHolder.java │ │ │ │ └── InfoUtil.java │ │ │ │ ├── services │ │ │ │ └── MediaPlayerService.java │ │ │ │ ├── media │ │ │ │ ├── MeasureHelper.java │ │ │ │ ├── SurfaceRenderView.java │ │ │ │ ├── MediaManager.java │ │ │ │ ├── TextureRenderView.java │ │ │ │ └── IjkVideoView.java │ │ │ │ ├── widget │ │ │ │ └── TouchLayout.java │ │ │ │ └── CommenPlayer.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── d │ │ │ └── lib │ │ │ └── commenplayer │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── d │ │ └── lib │ │ └── commenplayer │ │ └── ExampleInstrumentedTest.java ├── consumer-proguard-rules.pro ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── logo ├── logomark-black.png ├── logomark-color.png ├── logomark-white.png ├── vertical-black.png ├── vertical-color.png ├── vertical-white.png ├── horizontal-black.png ├── horizontal-color.png └── horizontal-white.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── CHANGELOG.md ├── doc ├── bashrc ├── compile-ijkplayer-zh.md └── compile-ijkplayer.md ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── README-zh.md ├── gradlew └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /lib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':lib' 2 | -------------------------------------------------------------------------------- /logo/logomark-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/logo/logomark-black.png -------------------------------------------------------------------------------- /logo/logomark-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/logo/logomark-color.png -------------------------------------------------------------------------------- /logo/logomark-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/logo/logomark-white.png -------------------------------------------------------------------------------- /logo/vertical-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/logo/vertical-black.png -------------------------------------------------------------------------------- /logo/vertical-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/logo/vertical-color.png -------------------------------------------------------------------------------- /logo/vertical-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/logo/vertical-white.png -------------------------------------------------------------------------------- /logo/horizontal-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/logo/horizontal-black.png -------------------------------------------------------------------------------- /logo/horizontal-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/logo/horizontal-color.png -------------------------------------------------------------------------------- /logo/horizontal-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/logo/horizontal-white.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_back.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_play.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_pause.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_volume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_volume.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_aplayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_aplayer.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_backward.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_forward.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_loading.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_brightness.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_brightness.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_fullscreen_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_fullscreen_in.png -------------------------------------------------------------------------------- /lib/src/main/res/drawable-xhdpi/lib_player_ic_fullscreen_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dsiner/CommenPlayer/HEAD/lib/src/main/res/drawable-xhdpi/lib_player_ic_fullscreen_out.png -------------------------------------------------------------------------------- /lib/src/main/java/com/d/lib/commenplayer/listener/OnNetworkListener.java: -------------------------------------------------------------------------------- 1 | package com.d.lib.commenplayer.listener; 2 | 3 | public interface OnNetworkListener { 4 | void onIgnoreMobileData(); 5 | } 6 | -------------------------------------------------------------------------------- /lib/src/main/java/com/d/lib/commenplayer/listener/OnAnimatorUpdateListener.java: -------------------------------------------------------------------------------- 1 | package com.d.lib.commenplayer.listener; 2 | 3 | public interface OnAnimatorUpdateListener { 4 | void onAnimationUpdate(float factor); 5 | } 6 | -------------------------------------------------------------------------------- /lib/consumer-proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -keep class com.d.lib.commenplayer.** {*;} 2 | 3 | -keep class tv.danmaku.ijk.media.** {*;} 4 | 5 | -dontwarn com.nineoldandroids.** 6 | -keep class com.nineoldandroids.** {*;} 7 | -keep interface com.nineoldandroids.** {*;} 8 | -------------------------------------------------------------------------------- /lib/src/main/res/drawable/lib_player_corner_bg_control.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /lib/src/main/res/drawable/lib_player_corner_bg_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon May 29 13:25:39 CST 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-4.4-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #000000 7 | 8 | -------------------------------------------------------------------------------- /lib/src/main/res/drawable/lib_player_gradient_bg_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /lib/src/main/res/drawable/lib_player_gradient_bg_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /lib/src/main/res/drawable/lib_player_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Changelog 2 | -------------------------------- 3 | 4 | Version: Last 5 | -------------------------------- 6 | - Internationalization 7 | - Optimization 8 | - Gradle: upgrade to 4.4 9 | 10 | Version: 1.0.1 11 | -------------------------------- 12 | - resourcePrefix 13 | 14 | Version: 1.0.0 15 | -------------------------------- 16 | - Initial Build -------------------------------------------------------------------------------- /lib/src/main/java/com/d/lib/commenplayer/listener/OnShowThumbnailListener.java: -------------------------------------------------------------------------------- 1 | package com.d.lib.commenplayer.listener; 2 | 3 | import android.widget.ImageView; 4 | 5 | public interface OnShowThumbnailListener { 6 | 7 | /** 8 | * Return the cover view, let the user set it autonomously 9 | */ 10 | void onShowThumbnail(ImageView ivThumbnail); 11 | } 12 | -------------------------------------------------------------------------------- /lib/src/main/res/drawable/lib_player_seekbar_play_thumb.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /doc/bashrc: -------------------------------------------------------------------------------- 1 | export JAVA_HOME=/home/dsiner/Dev/App/jdk1.8.0_131 2 | export JRE_HOME=${JAVA_HOME}/jre 3 | export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib 4 | export PATH=${JAVA_HOME}/bin:$PATH 5 | 6 | export ANDROID_SDK=/home/dsiner/Dev/App/android-sdk-linux 7 | export PATH=${PATH}:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools 8 | 9 | export ANDROID_NDK=/home/dsiner/Dev/App/android-ndk-r13 10 | export PATH=$PATH:ANDROID_NDK 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/d/commenplayer/App.java: -------------------------------------------------------------------------------- 1 | package com.d.commenplayer; 2 | 3 | import android.app.Application; 4 | 5 | import com.d.lib.common.component.network.NetworkCompat; 6 | 7 | /** 8 | * App 9 | * Created by D on 2018/9/22. 10 | */ 11 | public class App extends Application { 12 | 13 | @Override 14 | public void onCreate() { 15 | super.onCreate(); 16 | NetworkCompat.init(getApplicationContext()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/test/java/com/d/commenplayer/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.d.commenplayer; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /lib/src/main/res/values-zh-rCN/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 当前为移动网络,是否继续播放? 4 | 继续播放 5 | 播放结束,是否重新播放? 6 | 重新播放 7 | 播放失败,是否重试? 8 | 重试 9 | 10 | -------------------------------------------------------------------------------- /lib/src/test/java/com/d/lib/commenplayer/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.d.lib.commenplayer; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /lib/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Currently mobile data, do you want to continue playing? 4 | Continue playing 5 | End of playback, replay? 6 | Replay 7 | Play failed, retry? 8 | Retry 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | 18 | # Gradle files 19 | .gradle/ 20 | build/ 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | 31 | # Android Studio Navigation editor temp files 32 | .navigation/ 33 | 34 | # Android Studio captures folder 35 | captures/ 36 | 37 | # Intellij 38 | *.iml 39 | .idea/ 40 | 41 | # Keystore files 42 | *.jks -------------------------------------------------------------------------------- /lib/src/main/res/drawable/lib_player_seekbar_adjust.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/adapter_player.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 18 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | org.gradle.jvmargs=-Xmx1536m -Dfile.encoding=UTF-8 15 | android.injected.testOnly=false -------------------------------------------------------------------------------- /lib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/d/commenplayer/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.d.commenplayer; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.d.commenplayer", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/androidTest/java/com/d/lib/commenplayer/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.d.lib.commenplayer; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.d.lib.commenplayer.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CommenPlayer 4 | 5 | http://vpls.cdn.videojj.com/scene/video02_720p.mp4 6 | http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4 7 | http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/05/2017-05-17_17-33-30.mp4 8 | http://9890.vod.myqcloud.com/9890_9c1fa3e2aea011e59fc841df10c92278.f20.mp4 9 | http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8 10 | https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8 11 | rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov 12 | rtmp://live.hkstv.hk.lxdns.com/live/hks 13 | 14 | -------------------------------------------------------------------------------- /lib/src/main/res/layout/lib_player_layout_aplayer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 15 | 16 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /lib/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /lib/src/main/res/drawable/lib_player_seekbar_play.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 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/d/commenplayer/model/MediaModel.java: -------------------------------------------------------------------------------- 1 | package com.d.commenplayer.model; 2 | 3 | import android.content.Context; 4 | 5 | import com.d.commenplayer.R; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | public class MediaModel { 11 | public String url = "http://vpls.cdn.videojj.com/scene/video02_720p.mp4"; 12 | public int position; 13 | 14 | public static List getDatas(Context context, int size) { 15 | final int[] urlResIds = new int[]{ 16 | R.string.url1, 17 | R.string.url2, 18 | R.string.url3, 19 | R.string.url4, 20 | R.string.url5, 21 | R.string.url6, 22 | R.string.url7, 23 | R.string.url8,}; 24 | final List list = new ArrayList<>(); 25 | for (int i = 0; i < size; i++) { 26 | MediaModel model = new MediaModel(); 27 | model.url = context.getResources().getString(urlResIds[i % urlResIds.length]); 28 | list.add(model); 29 | } 30 | return list; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | 6 | defaultConfig { 7 | applicationId "com.d.commenplayer" 8 | minSdkVersion 14 9 | targetSdkVersion 26 10 | versionCode 1 11 | versionName "1.0" 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | } 15 | 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | 23 | lintOptions { 24 | abortOnError false 25 | } 26 | } 27 | 28 | dependencies { 29 | testImplementation 'junit:junit:4.12' 30 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 31 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 32 | 33 | implementation fileTree(dir: 'libs', include: ['*.jar']) 34 | implementation project(':lib') 35 | 36 | implementation 'com.android.support:appcompat-v7:27.1.1' 37 | implementation 'com.dsiner.lib:common:1.2.1' 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 18 | 19 |