diff --git a/README.md b/README.md index 1baeb9f61419633dbbe712a990e5eddbf5ba88a7..1c16c7cef606e8801d68fd6783bc68fe058d8fc3 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ com.shuyu gsyVideoPlayer - 1.1.3 + 1.1.4 pom ``` ``` -compile 'com.shuyu:gsyVideoPlayer:1.1.3' +compile 'com.shuyu:gsyVideoPlayer:1.1.4' ``` ## 效果,录屏下的屏幕旋转和实际有些出入 @@ -37,13 +37,23 @@ compile 'com.shuyu:gsyVideoPlayer:1.1.3' *

3、详情模式

-## 1.1.3 +## 1.1.4 * 优化了第一种列表的全屏动画,5.0以上展开和返回过渡顺畅,支持自动旋转的开启与关闭 +* 修改了全屏下的滑动接口不正常问题,全屏下自动变为滑动的,非全屏可以设置。 * GIF 效果

+``` +/** + * 是否可以滑动界面改变进度,声音等 + */ +public void setIsTouchWiget(boolean isTouchWiget) + +``` + + ## 1.1.2 * 增加了TAG和position来实现第一种list列表(非ListVideoUtil模式的列表实现)的滑动错位问题 diff --git a/app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java b/app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java index a65d54106fda99e513a67ee9e5d8a0f2726c4f5b..fc658c6164c8f977fcb98e8ac37e17678298f336 100644 --- a/app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java +++ b/app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java @@ -53,6 +53,8 @@ public class DetailPlayer extends AppCompatActivity { orientationUtils = new OrientationUtils(this, detailPlayer); orientationUtils.setEnable(false); + detailPlayer.setIsTouchWiget(true); + detailPlayer.getFullscreenButton().setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/app/src/main/java/com/example/gsyvideoplayer/PlayActivity.java b/app/src/main/java/com/example/gsyvideoplayer/PlayActivity.java index 9ffc201ca4432a771b5496354efc23f985cf4478..e937e60132ba302b783835f0493edcbbd16c5376 100644 --- a/app/src/main/java/com/example/gsyvideoplayer/PlayActivity.java +++ b/app/src/main/java/com/example/gsyvideoplayer/PlayActivity.java @@ -72,6 +72,9 @@ public class PlayActivity extends AppCompatActivity { } }); + //是否可以滑动调整 + videoPlayer.setIsTouchWiget(true); + //设置返回按键功能 videoPlayer.getBackButton().setOnClickListener(new View.OnClickListener() { @Override diff --git a/gradle.properties b/gradle.properties index b7f99da8b6e062135261f34895e762656764f189..5ced5dfac3e1c0f84ea28406a981c3c7518d8474 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,7 +18,7 @@ org.gradle.jvmargs=-Xmx1536m BINTRAY_USER= BINTRAY_KEY= PROJ_GROUP=com.shuyu -PROJ_VERSION=1.1.3 +PROJ_VERSION=1.1.4 PROJ_NAME=gsyVideo PROJ_WEBSITEURL=hhttps://github.com/CarGuo/GSYVideoPlayer PROJ_ISSUETRACKERURL= diff --git a/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java b/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java index da2f5a64e57999db887190a624674a71ca608cec..2e1589dc469792f8bbc60223c25d82aa9bd158a4 100644 --- a/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java +++ b/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java @@ -64,7 +64,6 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View. public static boolean WIFI_TIP_DIALOG_SHOWED = false; - protected static Timer UPDATE_PROGRESS_TIMER; @@ -116,8 +115,6 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View. protected boolean mTouchingProgressBar = false; - protected boolean mIfCurrentIsFullscreen = false; - protected boolean mIsTouchWiget = false; protected boolean mChangeVolume = false;//是否改变音量 @@ -880,6 +877,9 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View. return mIsTouchWiget; } + /** + * 是否可以滑动界面改变进度,声音等 + */ public void setIsTouchWiget(boolean isTouchWiget) { this.mIsTouchWiget = isTouchWiget; } diff --git a/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/ListVideoUtil.java b/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/ListVideoUtil.java index 0b946be298d8cf6d2fc0fbb897275f7ae1106204..178616b881f4d484b16c0f1b7305ed45cd766037 100644 --- a/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/ListVideoUtil.java +++ b/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/utils/ListVideoUtil.java @@ -128,6 +128,7 @@ public class ListVideoUtil { } fullViewContainer.setBackgroundColor(Color.BLACK); fullViewContainer.addView(gsyVideoPlayer); + gsyVideoPlayer.setIfCurrentIsFullscreen(true); gsyVideoPlayer.getFullscreenButton().setImageResource(R.drawable.video_shrink); gsyVideoPlayer.getBackButton().setVisibility(View.VISIBLE); //设置旋转 @@ -163,6 +164,7 @@ public class ListVideoUtil { isFull = false; fullViewContainer.removeAllViews(); orientationUtils.setEnable(false); + gsyVideoPlayer.setIfCurrentIsFullscreen(false); fullViewContainer.setBackgroundColor(Color.TRANSPARENT); listParent.addView(gsyVideoPlayer); gsyVideoPlayer.getFullscreenButton().setImageResource(R.drawable.video_enlarge); diff --git a/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java b/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java index a25411895af09252c3137d2c413727741ba5451f..46cf3b9a2f4ce17a4d117fd704806dc01803aae5 100644 --- a/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java +++ b/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/video/GSYBaseVideoPlayer.java @@ -54,6 +54,8 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia protected boolean mRotateViewAuto = true; //是否自动旋转 + protected boolean mIfCurrentIsFullscreen = false; + protected Context mContext; protected String mUrl; @@ -123,6 +125,7 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia lp.width = ViewGroup.LayoutParams.MATCH_PARENT; lp.gravity = Gravity.CENTER; gsyVideoPlayer.setLayoutParams(lp); + gsyVideoPlayer.setIfCurrentIsFullscreen(true); mOrientationUtils = new OrientationUtils((Activity) context, gsyVideoPlayer); mOrientationUtils.setEnable(mRotateViewAuto); } @@ -337,6 +340,15 @@ public abstract class GSYBaseVideoPlayer extends FrameLayout implements GSYMedia return mRotateViewAuto; } + + public boolean isIfCurrentIsFullscreen() { + return mIfCurrentIsFullscreen; + } + + public void setIfCurrentIsFullscreen(boolean ifCurrentIsFullscreen) { + this.mIfCurrentIsFullscreen = ifCurrentIsFullscreen; + } + /** * 自动旋转 */ diff --git a/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_enlarge.png b/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_enlarge.png index ff88553ef1d989076aa4960cc78f07cde0e24a98..dcf9b88f5b3c7bcae025b803470b71b3a765e212 100644 Binary files a/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_enlarge.png and b/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_enlarge.png differ diff --git a/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_loading_bg.png b/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_loading_bg.png index cd1f0342872e9fba4278dbdce649dd784fe1e079..bc811b16086503438b4847af44dbf32f7e685db1 100644 Binary files a/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_loading_bg.png and b/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_loading_bg.png differ diff --git a/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_shrink.png b/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_shrink.png index 461f77762daa99c91ca0db7ed2e0fada45039b8b..c600c81f111a905f4ff901db627e7eccbc9bc76b 100644 Binary files a/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_shrink.png and b/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_shrink.png differ diff --git a/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_volume_icon.png b/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_volume_icon.png index 68876bf113b4350044f94aa50e6dd8de34f36225..deb5358e8d9e2d82a6faa0abc3974e35012a4c58 100644 Binary files a/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_volume_icon.png and b/gsyVideoPlayer/src/main/res/drawable-xxhdpi/video_volume_icon.png differ diff --git a/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb.xml b/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb.xml index 3cb70964c78dd3988fc1371defd4f5360793d67b..613edc9059852a8810b2a05ae8023f6832b9c47f 100644 --- a/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb.xml +++ b/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb.xml @@ -1,5 +1,5 @@ - - + + diff --git a/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb_normal.xml b/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb_normal.xml index 198549b26d855ce5467e52a04ef28bf2053c690a..347dd381459b8530de933ee15b160f8f9cb788e1 100644 --- a/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb_normal.xml +++ b/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb_normal.xml @@ -1,8 +1,8 @@ - + xmlns:android="http://schemas.android.com/apk/res/android"> + + android:height="14.0dip" + android:width="14.0dip" /> diff --git a/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb_pressed.xml b/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb_pressed.xml index 4c4d3b67956c8baed1f3bbc784973258fa7a790f..23a89e2e4be5f5058ee9cf9ea278a9a34db7e686 100644 --- a/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb_pressed.xml +++ b/gsyVideoPlayer/src/main/res/drawable/video_seek_thumb_pressed.xml @@ -1,8 +1,8 @@ - + xmlns:android="http://schemas.android.com/apk/res/android"> + + android:height="14.0dip" + android:width="14.0dip" /> diff --git a/gsyVideoPlayer/src/main/res/values/colors.xml b/gsyVideoPlayer/src/main/res/values/colors.xml index 32668c79359eb1703aaedbd924c1a73451dc1d61..752afc55420328d98d442d1729b3eee433085caf 100644 --- a/gsyVideoPlayer/src/main/res/values/colors.xml +++ b/gsyVideoPlayer/src/main/res/values/colors.xml @@ -1,6 +1,6 @@ - #f77500 + #005fff