diff --git a/README.md b/README.md index 5520bb688..e69aac359 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -#节操视频播放器 [![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html) [![Maven Central](https://img.shields.io/badge/Maven%20Central-1.6-green.svg)](http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C1.6%7Caar) [![Licenses](https://img.shields.io/badge/license-MIT-green.svg)](http://choosealicense.com/licenses/mit/) +#节操视频播放器 [![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html) [![Maven Central](https://img.shields.io/badge/Maven%20Central-1.6-green.svg)](http://search.maven.org/#artifactdetails%7Cfm.jiecao%7Cjiecaovideoplayer%7C1.6%7Caar) [![Licenses](https://img.shields.io/badge/license-MIT-green.svg)](http://choosealicense.com/licenses/mit/) [![GitHub stars](https://img.shields.io/github/stars/lipangit/jiecaovideoplayer.svg?style=social&label=Star)]() 真正实现Android的全屏功能,励志成为Android平台使用最广泛的视频播放控件,GitFlow流程开发develop分支是最新版本 @@ -19,12 +19,12 @@ ##使用 -引入类库 +1.引入类库 ```gradle compile 'fm.jiecao:jiecaovideoplayer:1.6' ``` -添加布局 +2.添加布局 ```xml ``` -设置视频地址、缩略图地址、标题 +3.设置视频地址、缩略图地址、标题 ```java JCVideoPlayer videoController = (JCVideoPlayer) findViewById(R.id.videocontroller); videoController.setUp("http://2449.vod.myqcloud.com/2449_43b6f696980311e59ed467f22794e792.f20.mp4", "http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640", "嫂子别摸我"); ``` +4.在包含播放器的`Fragment`或`Activity`的`onPause()`方法中调用`JCVideoPlayer.releaseAllVideos();` + +####其他接口 设置皮肤,可以指定某个播放器的皮肤,也可以设置全局皮肤,优先级:某个播放器皮肤>全局皮肤>默认皮肤 ```java @@ -46,21 +49,34 @@ JCVideoPlayer.setGlobleSkin();//设置全局皮肤 videoController.setSkin();//设置这一个播放器的皮肤 ``` -停止所有视频 +修改缩略图的scalType,默认的缩略图的scaleType是fitCenter,这时候图片如果和屏幕尺寸不同的话左右或上下会有黑边,可以根据客户端需要改成fitXY或者其他模式 ```java -JCVideoPlayer.releaseAllVideo(); +JCVideoPlayer.setThumbImageViewScalType(ImageView.ScaleType.FIT_XY); ``` -在包含播放器的`Fragment`或`Activity`的`onPause()`方法中调用`JCVideoPlayer.releaseAllVideos();` - 在ListView和ViewPager中将视频移除屏幕外,会在onDetachedFromWindow时重置视频。 目标是在库外只需要添加布局,添加配置,其他的问题都在库内判断和操作。 - + +混淆 +``` +##Eventbus混淆 +-keepclassmembers class ** { + public void onEvent*(***); +} +# Only required if you use AsyncExecutor +-keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent { + public (java.lang.Throwable); +} +# Don't warn for missing support classes +-dontwarn de.greenrobot.event.util.*$Support +-dontwarn de.greenrobot.event.util.*$SupportManagerFragment +``` + ##下载 - * **[jiecaovideoplayer-1.5-demo.apk](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.5-demo.apk)** - * **[jiecaovideoplayer-1.5.aar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.5.aar)** - * **[jiecaovideoplayer-1.5-javadoc.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.5-javadoc.jar)** - * **[jiecaovideoplayer-1.5-sources.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.5-sources.jar)** + * **[jiecaovideoplayer-1.6-demo.apk](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.6-demo.apk)** + * **[jiecaovideoplayer-1.6.aar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.6.aar)** + * **[jiecaovideoplayer-1.6-javadoc.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.6-javadoc.jar)** + * **[jiecaovideoplayer-1.6-sources.jar](https://raw.githubusercontent.com/lipangit/jiecaovideoplayer/develop/downloads/jiecaovideoplayer-1.6-sources.jar)** ## License diff --git a/app/build.gradle b/app/build.gradle index 739906e76..7ba15652a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "fm.jiecao.jiecaovideoplayer" minSdkVersion 16 targetSdkVersion 23 - versionCode 17 - versionName "1.6" + versionCode 18 + versionName "1.7" } buildTypes { release { diff --git a/app/src/main/java/fm/jiecao/jiecaovideoplayer/DemoApplication.java b/app/src/main/java/fm/jiecao/jiecaovideoplayer/DemoApplication.java index 7b8c549f2..3e218785b 100644 --- a/app/src/main/java/fm/jiecao/jiecaovideoplayer/DemoApplication.java +++ b/app/src/main/java/fm/jiecao/jiecaovideoplayer/DemoApplication.java @@ -31,18 +31,15 @@ public class DemoApplication extends Application { public void onCreate() { super.onCreate(); application = this; - + initUniversalImageLoader(); + //这里将会设置所有播放器的皮肤 | Here the player will set all the skin // JCVideoPlayer.setGlobleSkin(R.color.colorPrimary, R.color.colorAccent, R.drawable.skin_seek_progress, // R.color.bottom_bg, R.drawable.skin_enlarge_video, R.drawable.skin_shrink_video); - initUniversalImageLoader(); + //这里将会改变所有缩略图的ScaleType | Here will change all thumbnails ScaleType +// JCVideoPlayer.setThumbImageViewScalType(ImageView.ScaleType.FIT_XY); } private void initUniversalImageLoader() { - // This configuration tuning is custom. You can tune every option, you may tune some of them, - // or you can create default configuration by - // ImageLoaderConfiguration.createDefault(this); - // method. - DisplayImageOptions options = new DisplayImageOptions.Builder() .showImageOnLoading(new ColorDrawable(Color.parseColor("#f0f0f0"))) .resetViewBeforeLoading(true) @@ -51,13 +48,10 @@ private void initUniversalImageLoader() { .considerExifParams(true) .imageScaleType(ImageScaleType.EXACTLY_STRETCHED) .bitmapConfig(Bitmap.Config.RGB_565) -// .displayer(new FadeInBitmapDisplayer(1000)) // 设置图片渐显的时间 -// .delayBeforeLoading(300) // 下载前的延迟时间 .build(); int memClass = ((ActivityManager) getSystemService(Context.ACTIVITY_SERVICE)) .getMemoryClass(); - // Use 1/8th of the available memory for this memory cache. int memCacheSize = 1024 * 1024 * memClass / 8; File cacheDir = new File(Environment.getExternalStorageDirectory().getPath() + "/jiecao/cache"); @@ -73,9 +67,7 @@ private void initUniversalImageLoader() { .diskCache(new UnlimitedDiskCache(cacheDir))//自定义缓存路径 .imageDownloader(new BaseImageDownloader(this, 5 * 1000, 30 * 1000)) // connectTimeout (5 s), readTimeout (30 s)超时时间 .defaultDisplayImageOptions(options) -// .writeDebugLogs() // Remove for release app .build(); - // Initialize ImageLoader with configuration. ImageLoader.getInstance().init(config); } diff --git a/app/src/main/java/fm/jiecao/jiecaovideoplayer/ListActivity.java b/app/src/main/java/fm/jiecao/jiecaovideoplayer/ListActivity.java index c46e7c48c..2527958db 100644 --- a/app/src/main/java/fm/jiecao/jiecaovideoplayer/ListActivity.java +++ b/app/src/main/java/fm/jiecao/jiecaovideoplayer/ListActivity.java @@ -14,7 +14,6 @@ public class ListActivity extends AppCompatActivity { ListView listView; - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/app/src/main/java/fm/jiecao/jiecaovideoplayer/MainActivity.java b/app/src/main/java/fm/jiecao/jiecaovideoplayer/MainActivity.java index eec452ac7..54ddf125c 100644 --- a/app/src/main/java/fm/jiecao/jiecaovideoplayer/MainActivity.java +++ b/app/src/main/java/fm/jiecao/jiecaovideoplayer/MainActivity.java @@ -6,9 +6,9 @@ import android.util.Log; import android.view.View; import android.widget.Button; -import android.widget.Toast; import de.greenrobot.event.EventBus; +import fm.jiecao.jcvideoplayer_lib.FullScreenActivity; import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer; import fm.jiecao.jcvideoplayer_lib.VideoEvents; @@ -108,7 +108,10 @@ public void onClick(View v) { startActivity(new Intent(MainActivity.this, ListViewpagerActivity.class)); break; case R.id.to_fullscreen: - Toast.makeText(MainActivity.this, "coming soon", Toast.LENGTH_SHORT).show(); + FullScreenActivity.toActivity(this, + "http://2449.vod.myqcloud.com/2449_43b6f696980311e59ed467f22794e792.f20.mp4", + "http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640", + "嫂子别摸我"); break; case R.id.to_changecolor_activity: startActivity(new Intent(this, SetSkinActivity.class)); diff --git a/build.gradle b/build.gradle index 481a2e27c..9ba597255 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0-beta5' + classpath 'com.android.tools.build:gradle:2.0.0-beta6' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/downloads/jiecaovideoplayer-1.5-demo.apk b/downloads/jiecaovideoplayer-1.5-demo.apk deleted file mode 100644 index 8f9c327ec..000000000 Binary files a/downloads/jiecaovideoplayer-1.5-demo.apk and /dev/null differ diff --git a/downloads/jiecaovideoplayer-1.5-javadoc.jar b/downloads/jiecaovideoplayer-1.5-javadoc.jar deleted file mode 100644 index 32533d613..000000000 Binary files a/downloads/jiecaovideoplayer-1.5-javadoc.jar and /dev/null differ diff --git a/downloads/jiecaovideoplayer-1.6-demo.apk b/downloads/jiecaovideoplayer-1.6-demo.apk new file mode 100644 index 000000000..b20a6235e Binary files /dev/null and b/downloads/jiecaovideoplayer-1.6-demo.apk differ diff --git a/downloads/jiecaovideoplayer-1.6-javadoc.jar b/downloads/jiecaovideoplayer-1.6-javadoc.jar new file mode 100644 index 000000000..11d2ebe95 Binary files /dev/null and b/downloads/jiecaovideoplayer-1.6-javadoc.jar differ diff --git a/downloads/jiecaovideoplayer-1.5-sources.jar b/downloads/jiecaovideoplayer-1.6-sources.jar similarity index 97% rename from downloads/jiecaovideoplayer-1.5-sources.jar rename to downloads/jiecaovideoplayer-1.6-sources.jar index 8c8fd92ee..746c444e4 100644 Binary files a/downloads/jiecaovideoplayer-1.5-sources.jar and b/downloads/jiecaovideoplayer-1.6-sources.jar differ diff --git a/downloads/jiecaovideoplayer-1.5.aar b/downloads/jiecaovideoplayer-1.6.aar similarity index 53% rename from downloads/jiecaovideoplayer-1.5.aar rename to downloads/jiecaovideoplayer-1.6.aar index d01396f80..9f80c7294 100644 Binary files a/downloads/jiecaovideoplayer-1.5.aar and b/downloads/jiecaovideoplayer-1.6.aar differ diff --git a/jcvideoplayer-lib/build.gradle b/jcvideoplayer-lib/build.gradle index c09557c02..a78d82847 100644 --- a/jcvideoplayer-lib/build.gradle +++ b/jcvideoplayer-lib/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 23 - versionCode 17 - versionName "1.6" + versionCode 18 + versionName "1.7" } buildTypes { release { diff --git a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/FullScreenActivity.java b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/FullScreenActivity.java index 56d555edd..2501c76eb 100644 --- a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/FullScreenActivity.java +++ b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/FullScreenActivity.java @@ -5,6 +5,7 @@ import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Bundle; +import android.view.View; import android.view.Window; import android.view.WindowManager; @@ -17,11 +18,22 @@ */ public class FullScreenActivity extends Activity { - public static void toActivity(Context context, int state, String url, String thumb, String title) { + static void toActivityFromNormal(Context context, int state, String url, String thumb, String title) { STATE = state; URL = url; THUMB = thumb; TITLE = title; + start = false; + Intent intent = new Intent(context, FullScreenActivity.class); + context.startActivity(intent); + } + + public static void toActivity(Context context, String url, String thumb, String title) { + STATE = JCVideoPlayer.CURRENT_STATE_NORMAL; + URL = url; + THUMB = thumb; + TITLE = title; + start = true; Intent intent = new Intent(context, FullScreenActivity.class); context.startActivity(intent); } @@ -36,6 +48,7 @@ public static void toActivity(Context context, int state, String url, String thu public static String THUMB; public static boolean manualQuit = false; protected static Skin skin; + static boolean start = false; @Override protected void onCreate(Bundle savedInstanceState) { @@ -43,7 +56,10 @@ protected void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + View decor = this.getWindow().getDecorView(); + decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); setContentView(R.layout.activity_fullscreen); + jcVideoPlayer = (JCVideoPlayer) findViewById(R.id.jcvideoplayer); if (skin != null) { jcVideoPlayer.setSkin(skin.titleColor, skin.timeColor, skin.seekDrawable, skin.bottomControlBackground, @@ -53,6 +69,9 @@ protected void onCreate(Bundle savedInstanceState) { jcVideoPlayer.setState(STATE); JCMediaManager.intance().setUuid(jcVideoPlayer.uuid); manualQuit = false; + if (start) { + jcVideoPlayer.ivStart.performClick(); + } } public void onEventMainThread(VideoEvents videoEvents) { diff --git a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCMediaManager.java b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCMediaManager.java index 5e0f64e24..3477f1d66 100644 --- a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCMediaManager.java +++ b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCMediaManager.java @@ -13,7 +13,8 @@ /** - * 统一管理MediaPlayer,管理视频的暂停播放进度全屏的功能 + *

统一管理MediaPlayer的地方,只有一个mediaPlayer实例,那么不会有多个视频同时播放,也节省资源。

+ *

Unified management MediaPlayer place, there is only one MediaPlayer instance, then there will be no more video broadcast at the same time, also save resources.

* Created by Nathen * On 2015/11/30 15:39 */ @@ -25,6 +26,7 @@ class JCMediaManager implements MediaPlayer.OnPreparedListener, MediaPlayer.OnCo private String prev_uuid = ""; public int currentVideoWidth = 0; public int currentVideoHeight = 0; + private static final String TAG = "JiecaoVideoplayer"; public static JCMediaManager intance() { if (jcMediaManager == null) { @@ -84,10 +86,10 @@ public boolean onError(MediaPlayer mp, int what, int extra) { } public void setUuid(String uuid) { - Log.i("uuid::", "0 " + uuid + " prevuuid " + prev_uuid); + Log.i(TAG, "0 " + uuid + " prevuuid " + prev_uuid); // backUpUuid(); this.uuid = uuid; - Log.i("uuid::", "1 " + uuid + " prevuuid " + prev_uuid); + Log.i(TAG, "1 " + uuid + " prevuuid " + prev_uuid); } public void backUpUuid() { @@ -97,7 +99,7 @@ public void backUpUuid() { public void revertUuid() { this.uuid = this.prev_uuid; this.prev_uuid = ""; - Log.i("uuid::", "2 " + uuid + " prevuuid " + prev_uuid); + Log.i(TAG, "2 " + uuid + " prevuuid " + prev_uuid); } @Override diff --git a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCVideoPlayer.java b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCVideoPlayer.java index 2b266f925..663b88ddd 100644 --- a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCVideoPlayer.java +++ b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCVideoPlayer.java @@ -30,14 +30,17 @@ import de.greenrobot.event.EventBus; /** - * @see 节操视频播放器 Github - *
+ *

节操视频播放器,库的外面所有使用的接口也在这里

+ *

Jiecao video player,all outside the library interface is here

+ * + * @see JiecaoVideoplayer Github + * Created by Nathen * On 2015/11/30 11:59 */ public class JCVideoPlayer extends FrameLayout implements View.OnClickListener, SeekBar.OnSeekBarChangeListener, SurfaceHolder.Callback, View.OnTouchListener { //控件 - ImageView ivStart; + public ImageView ivStart; ProgressBar pbLoading, pbBottom; ImageView ivFullScreen; SeekBar skProgress; @@ -81,9 +84,11 @@ public class JCVideoPlayer extends FrameLayout implements View.OnClickListener, // 一些临时表示状态的变量 private boolean touchingProgressBar = false; - static boolean isFromFullScreenBackHere = false;//如果是true表示这个正在不是全屏,并且全屏刚推出,总之进入过全屏 + private static boolean isFromFullScreenBackHere = false;//如果是true表示这个正在不是全屏,并且全屏刚推出,总之进入过全屏 static boolean isClickFullscreen = false; + private static ImageView.ScaleType speScalType = null; + public JCVideoPlayer(Context context, AttributeSet attrs) { super(context, attrs); uuid = UUID.randomUUID().toString(); @@ -121,27 +126,31 @@ private void init(Context context) { rlParent.setOnClickListener(this); ivBack.setOnClickListener(this); skProgress.setOnTouchListener(this); - + if (speScalType != null) { + ivThumb.setScaleType(speScalType); + } } /** - * 配置要播放的内容 + *

配置要播放的内容

+ *

Configuring the Content to Play

* - * @param url 视频地址 - * @param thumb 缩略图地址 - * @param title 标题 + * @param url 视频地址 | Video address + * @param thumb 缩略图地址 | Thumbnail address + * @param title 标题 | title */ public void setUp(String url, String thumb, String title) { setUp(url, thumb, title, true); } /** - * 配置要播放的内容 + *

配置要播放的内容

+ *

Configuring the Content to Play

* - * @param url 视频地址 - * @param thumb 缩略图地址 - * @param title 标题 - * @param ifShowTitle 是否在非全屏下显示标题 + * @param url 视频地址 | Video address + * @param thumb 缩略图地址 | Thumbnail address + * @param title 标题 | title + * @param ifShowTitle 是否在非全屏下显示标题 | The title is displayed in full-screen under */ public void setUp(String url, String thumb, String title, boolean ifShowTitle) { setSkin(); @@ -175,11 +184,12 @@ public void setUp(String url, String thumb, String title, boolean ifShowTitle) { } /** - * 只在全全屏中调用的方法 + *

只在全全屏中调用的方法

+ *

Only in fullscreen can call this

* - * @param url 视频地址 - * @param thumb 缩略图地址 - * @param title 标题 + * @param url 视频地址 | Video address + * @param thumb 缩略图地址 | Thumbnail address + * @param title 标题 | title */ public void setUpForFullscreen(String url, String thumb, String title) { setSkin(); @@ -207,9 +217,10 @@ public void setUpForFullscreen(String url, String thumb, String title) { } /** - * 设置视频的状态 + *

只在全全屏中调用的方法

+ *

Only in fullscreen can call this

* - * @param state int型 + * @param state int state */ public void setState(int state) { this.CURRENT_STATE = state; @@ -392,7 +403,7 @@ public void onClick(View v) { JCMediaManager.intance().mediaPlayer.setDisplay(null); JCMediaManager.intance().backUpUuid(); isClickFullscreen = true; - FullScreenActivity.toActivity(getContext(), CURRENT_STATE, url, thumb, title); + FullScreenActivity.toActivityFromNormal(getContext(), CURRENT_STATE, url, thumb, title); sendPointEvent(VideoEvents.POINT_ENTER_FULLSCREEN); } clickfullscreentime = System.currentTimeMillis(); @@ -664,7 +675,8 @@ public void surfaceDestroyed(SurfaceHolder holder) { } /** - * 停止所有音频的播放 + *

停止所有音频的播放

+ *

release all videos

*/ public static void releaseAllVideos() { if (!isClickFullscreen) { @@ -676,9 +688,10 @@ public static void releaseAllVideos() { } /** - * 有特殊需要的客户端 + *

有特殊需要的客户端

+ *

Clients with special needs

* - * @param onClickListener 开始按钮点击的回调函数 + * @param onClickListener 开始按钮点击的回调函数 | Click the Start button callback function */ @Deprecated public void setStartListener(OnClickListener onClickListener) { @@ -729,16 +742,29 @@ private void loadMp3Thum() { } /** - * 只设置这一个播放器的皮肤 - * 这个需要在setUp播放器的属性之前调用,因为enlarge图标的原因 - * 所有参数如果不需要修改的设为0 + *

默认的缩略图的scaleType是fitCenter,这时候图片如果和屏幕尺寸不同的话左右或上下会有黑边,可以根据客户端需要改成fitXY或这其他模式

+ *

The default thumbnail scaleType is fitCenter, and this time the picture if different screen sizes up and down or left and right, then there will be black bars, or it may need to change fitXY other modes based on the client

* - * @param titleColor 标题颜色 - * @param timeColor 时间颜色 - * @param seekDrawable 滑动条颜色 - * @param bottomControlBackground 低栏背景 - * @param enlargRecId 全屏背景 - * @param shrinkRecId 退出全屏背景 + * @param thumbScaleType 缩略图的scalType | Thumbnail scaleType + */ + public static void setThumbImageViewScalType(ImageView.ScaleType thumbScaleType) { + speScalType = thumbScaleType; + } + + /** + *

只设置这一个播放器的皮肤
+ * 这个需要在setUp播放器的属性之前调用,因为enlarge图标的原因
+ * 所有参数如果不需要修改的设为0

+ *

This setting only one player skin
+ * This requires the player before setUp property called, because of the enlarge icon
+ * If you do not modify all parameters can be set to 0

+ * + * @param titleColor 标题颜色 | title color + * @param timeColor 时间颜色 | time color + * @param seekDrawable 滑动条颜色 | seekbar color + * @param bottomControlBackground 低栏背景 | background color + * @param enlargRecId 全屏背景 | fullscreen background + * @param shrinkRecId 退出全屏背景 | quit fullscreen background quit fullscreen */ public void setSkin(int titleColor, int timeColor, int seekDrawable, int bottomControlBackground, int enlargRecId, int shrinkRecId) { @@ -747,16 +773,8 @@ public void setSkin(int titleColor, int timeColor, int seekDrawable, int bottomC } /** - * 设置所有播放器的皮肤 - * 这个只要在初始化想要换肤的播放器之前运行即可,可以在application中也可以在activity中 - * 所有参数如果不需要修改的设为0 - * - * @param titleColor 标题颜色 - * @param timeColor 时间颜色 - * @param seekDrawable 滑动条颜色 - * @param bottomControlBackground 低栏背景 - * @param enlargRecId 全屏背景 - * @param shrinkRecId 退出全屏背景 + *

设置应用内所有播放器的皮肤

+ *

Apply all settings within the player skin

*/ public static void setGlobleSkin(int titleColor, int timeColor, int seekDrawable, int bottomControlBackground, int enlargRecId, int shrinkRecId) { diff --git a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/ResizeSurfaceView.java b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/ResizeSurfaceView.java index 3cf31ff4a..a29ea99ee 100644 --- a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/ResizeSurfaceView.java +++ b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/ResizeSurfaceView.java @@ -6,8 +6,11 @@ import android.view.SurfaceView; /** - * 自适应视频大小的surfaceview,在这个view上播放的视频都是尺寸适配的 - * 在布局的时候有坑,比如relativelayout中无法全屏,要嵌套一个linearlayout + *

参照Android系统的VideoView的onMeasure方法 + *
注意!relativelayout中无法全屏,要嵌套一个linearlayout

+ *

Referring Android system Video View of onMeasure method + *
NOTE! Can not fullscreen relativelayout, to nest a linearlayout

+ *

* Created by Nathen * On 2015/12/08 10:58 */ diff --git a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/Utils.java b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/Utils.java index f4c4901f4..ba0c30653 100644 --- a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/Utils.java +++ b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/Utils.java @@ -12,11 +12,10 @@ import java.util.Locale; /** - * 最俗的类名 * Created by Nathen * On 2016/02/21 12:25 */ -public class Utils { +class Utils { public static DisplayImageOptions getDefaultDisplayImageOption() { DisplayImageOptions options = new DisplayImageOptions.Builder() .showImageOnLoading(new ColorDrawable(Color.parseColor("#f0f0f0"))) diff --git a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/VideoEvents.java b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/VideoEvents.java index 70465d6dc..9215e37ca 100644 --- a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/VideoEvents.java +++ b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/VideoEvents.java @@ -1,6 +1,8 @@ package fm.jiecao.jcvideoplayer_lib; /** + *

关于eventbus的使用进行过多次探索,目前认为这么使用是最容易理解的

+ *

Explore about the use of the eventbus many times, now think so used is the most easy to understand

* Created by Nathen * On 2015/11/30 12:19 */ @@ -17,24 +19,79 @@ public class VideoEvents { public static final int VE_MEDIAPLAYER_SEEKCOMPLETE = 366009; public static final int VE_MEDIAPLAYER_RESIZE = 366010; + + // 埋点事件 + // Buried point events /** - * 给统计用的埋点 + *

用户点击播放按钮,播放视频

+ *

Users click the play button, play the video

*/ public static final int POINT_START_ICON = 367001; + /** + *

用户点击缩略图,播放视频

+ *

Users click on the thumbnail, play the video

+ */ public static final int POINT_START_THUMB = 367002; + /** + *

暂停视频(非全屏)

+ *

Pause the video (not fullscreen)

+ */ public static final int POINT_STOP = 367003; + /** + *

暂停视频(全屏)

+ *

Pause the video (full screen)

+ */ public static final int POINT_STOP_FULLSCREEN = 367004; + /** + *

用户点击播放按钮,暂停状态下继续播放视频(非全屏)

+ *

User clicks the play button, pause state continues to play a video (not fullscreen)

+ */ public static final int POINT_RESUME = 367014; + /** + *

用户点击播放按钮,暂停状态下继续播放视频(全屏)

+ *

User clicks the play button, pause state continues to play video (full screen)

+ */ public static final int POINT_RESUME_FULLSCREEN = 367005; + /** + *

用户在播放视频时点击空白区域,显示播放控件和隐藏播放控件(非全屏)

+ *

When users click on a blank area of the video playback, display the playback controls and hide playback controls (not fullscreen)

+ */ public static final int POINT_CLICK_BLANK = 367006; + /** + *

用户在播放视频时点击空白区域,显示播放控件和隐藏播放控件(全屏)

+ *

When users click on a blank area of the video playback, display the playback controls and hide playback controls (full screen)

+ */ public static final int POINT_CLICK_BLANK_FULLSCREEN = 367007; + /** + *

用户修改播放进度(非全屏)

+ *

User to modify the playback progress (not fullscreen)

+ */ public static final int POINT_CLICK_SEEKBAR = 367008; + /** + *

用户修改播放进度(全屏)

+ *

User to modify the playback progress (full screen)

+ */ public static final int POINT_CLICK_SEEKBAR_FULLSCREEN = 367009; + /** + *

视频播放完了(非全屏)

+ *

Video playback over (not fullscreen)

+ */ public static final int POINT_AUTO_COMPLETE = 367010; + /** + *

视频播放完了(全屏)

+ *

Video playback over (full screen)

+ */ public static final int POINT_AUTO_COMPLETE_FULLSCREEN = 367011; - + /** + *

进入全屏

+ *

Enter full screen

+ */ public static final int POINT_ENTER_FULLSCREEN = 367012; + /** + *

退出全屏

+ *

Exit Full Screen

+ */ public static final int POINT_QUIT_FULLSCREEN = 367013; public int type; diff --git a/jcvideoplayer-lib/src/main/res/layout/video_control_view.xml b/jcvideoplayer-lib/src/main/res/layout/video_control_view.xml index c2110d865..66049906d 100644 --- a/jcvideoplayer-lib/src/main/res/layout/video_control_view.xml +++ b/jcvideoplayer-lib/src/main/res/layout/video_control_view.xml @@ -106,14 +106,15 @@