Skip to content

Commit

Permalink
Merge pull request #4 from molihuan/dev
Browse files Browse the repository at this point in the history
🔥🔥🔥Repair full screen flash back of player
  • Loading branch information
molihuan authored Jan 6, 2023
2 parents 03009ac + 5f1f9ae commit e57a24d
Show file tree
Hide file tree
Showing 25 changed files with 475 additions and 118 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "com.molihua.hlbmerge"
minSdk 21
targetSdk 33
versionCode 45
versionName "1.6.5beta"
versionCode 46
versionName "1.6.6"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 45,
"versionName": "1.6.5beta",
"versionCode": 46,
"versionName": "1.6.6",
"outputFile": "app-release.apk"
}
],
Expand Down
14 changes: 13 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
package="com.molihua.hlbmerge">

<application
android:name=".App"
Expand Down Expand Up @@ -41,6 +42,17 @@
<activity
android:name=".activity.impl.PlayVideoActivity"
android:configChanges="orientation|screenSize" />

<provider
android:authorities="com.molihua.hlbmerge.fileprovider"
android:name="androidx.core.content.FileProvider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

</application>

</manifest>
6 changes: 4 additions & 2 deletions app/src/main/assets/statement.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
本协议包括:特别鸣谢和《软件协议》。
本协议包括:特别鸣谢、《软件协议》、免责申明
一、特别鸣谢
为本软件开发提供重要帮助的开源项目以及其依赖项目和用户:
【ffmpeg开源项目】:此软件是基于ffmpeg进行开发的。
Expand Down Expand Up @@ -63,4 +63,6 @@
【其他条款】
(1)电子文本形式的授权协议和其附属的隐私政策如同双方书面签署的协议一样,具有完全的和等同的法律效力。您使用本软件或本服务即视为您已阅读并同意受本协议的约束。协议许可范围以外的行为,将直接违反本授权协议并构成侵权,我们有权随时终止授权,责令停止损害,并保留追究相关责任的权力。
(2)我们有权在必要时修改本协议条款。您可以在本软件的最新版本中查阅相关协议条款。本协议条款变更后,如果您继续使用本软件,即视为您已接受修改后的协议。如果您不接受修改后的协议,应当停止使用本软件。
(3)我们保留对本协议的最终解释权。
(3)我们保留对本协议的最终解释权。
三、免责申明
此软件是为了帮助网友合并音视频,你可以将它理解为一个专用的格式工厂,并不涉及破解相关内容,仅仅用于学习技术交流,严禁用于商业用途,请于24小时内删除,特此声明。
7 changes: 7 additions & 0 deletions app/src/main/assets/updataLog.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ <h2>
<h3><span>因为权限问题,输出路径不能设置为SD卡,缓存文件路径可以设置为SD卡,即SD卡只能读取不能写入</span></h3>


<h3><span>1.6.6版本(新)</span></h3>
<h4><span>更新日期:2023年1月6日</span></h4>
<p><span>----修复播放器全屏播放后返回闪退问题</span></p>
<p><span>----增加视频分享功能</span></p>
<p><span>----增加视频循环播放功能</span></p>
<p><span>----修复某些视频名称解析错误</span></p>

<h3><span>1.6.5beta版本(新)</span></h3>
<h4><span>更新日期:2023年1月4日</span></h4>
<p><span>----修复播放器闪退问题</span></p>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/molihua/hlbmerge/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void onCreate() {
//ffmpeg debug
RxFFmpegInvoke.getInstance().setDebug(false);
//路径选择器debug
PathSelector.setDebug(false);
PathSelector.setDebug(true);
//取消自动申请权限
PathSelectorConfig.setAutoGetPermission(false);
//XUpdate初始化
Expand All @@ -54,7 +54,7 @@ public void onCreate() {

private void initXUpdate() {
XUpdate.get()
.debug(true)
.debug(false)
.isWifiOnly(true) //默认设置只在wifi下检查版本更新
.isGet(true) //默认设置使用get请求检查版本
.isAutoMode(false) //默认设置非自动模式,可根据具体使用配置
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import com.molihua.hlbmerge.fragment.AbstractMainHandleFragment;
import com.molihua.hlbmerge.fragment.AbstractMainTitlebarFragment;
import com.molihua.hlbmerge.fragment.impl.MainCompleteFragment;
import com.molihua.hlbmerge.fragment.impl.MainFfmpegFragment;
import com.molihua.hlbmerge.fragment.impl.MainFileShowFragment;
import com.molihua.hlbmerge.fragment.impl.MainHandleFragment;
import com.molihua.hlbmerge.fragment.impl.MainTitlebarFragment;
import com.molihua.hlbmerge.fragment.impl.MainToolsFragment;
import com.molihua.hlbmerge.service.ICacheFileManager;
import com.molihua.hlbmerge.utils.FragmentTools;
import com.molihua.hlbmerge.utils.GeneralTools;
Expand Down Expand Up @@ -110,7 +110,7 @@ public void onGranted(@NonNull List<String> permissions, boolean all) {

mainTitlebarFragment = new MainTitlebarFragment();
mainFileShowFragment = new MainFileShowFragment();
mainFfmpegFragment = new MainFfmpegFragment();
mainFfmpegFragment = new MainToolsFragment();
mainCompleteFragment = new MainCompleteFragment();
mainHandleFragment = new MainHandleFragment();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.molihua.hlbmerge.R;
import com.molihua.hlbmerge.activity.BaseActivity;
import com.molihua.hlbmerge.controller.videocontroller.DKVideoController;
import com.molihua.hlbmerge.utils.FileTools;
import com.molihuan.pathselector.utils.Mtools;

import master.flame.danmaku.ui.widget.DanmakuView;
Expand All @@ -17,13 +18,15 @@
* @ClassName: PlayVideoActivity
* @Author: molihuan
* @Date: 2022/12/28/0:48
* @Description:
* @Description: 播放器
*/
public class PlayVideoActivity extends BaseActivity implements View.OnClickListener {
//复制路径按钮
private Button btn_copypath;
//更新弹幕按钮
private Button btn_updataxml;
//分享按钮
private Button shareBtn;

//DK播放器视图
private VideoView videoView;
Expand All @@ -47,6 +50,7 @@ public void getComponents() {
btn_copypath = findViewById(R.id.btn_copypath);
btn_updataxml = findViewById(R.id.btn_updataxml);
videoView = findViewById(R.id.play_video_view);
shareBtn = findViewById(R.id.btn_share);
}

@Override
Expand All @@ -66,6 +70,7 @@ public void initData() {

//开始播放
videoView.start();


}

Expand All @@ -78,6 +83,7 @@ public void initView() {
public void setListeners() {
btn_copypath.setOnClickListener(this);
btn_updataxml.setOnClickListener(this);
shareBtn.setOnClickListener(this);
}


Expand All @@ -89,6 +95,10 @@ public void onClick(View v) {
Mtools.toast("文件路径已复制到剪贴板");
break;
case R.id.btn_updataxml:
Mtools.toast("还在开发中...");
break;
case R.id.btn_share:
FileTools.shareFile(this, videoPath);
break;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.view.animation.Animation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -57,6 +58,8 @@ public class DKVideoController extends GestureVideoController implements View.On

private VideoSettingView videoSettingView;

private VideoBottomControlView bottomControlView;

public DanmakuView getDanmakuView() {
return videoDanmakuView.getDanmakuView();
}
Expand All @@ -65,6 +68,10 @@ public DanmakuContext getDanmakuContext() {
return videoDanmakuView.getDanmakuContext();
}

public VideoBottomControlView getBottomControlView() {
return bottomControlView;
}

public boolean isLocalXmlExists() {
return videoDanmakuView.isLocalXmlExists();
}
Expand Down Expand Up @@ -106,7 +113,7 @@ private void initControlView() {
//获取弹幕视图
mDanmakuView = getDanmakuView();

VideoBottomControlView bottomControlView = new VideoBottomControlView(mContext, this);
bottomControlView = new VideoBottomControlView(mContext, this);
VideoCompleteView videoCompleteView = new VideoCompleteView(mContext, mDanmakuView);
ErrorView errorView = new ErrorView(mContext);
PrepareView prepareView = new PrepareView(mContext);
Expand All @@ -116,8 +123,8 @@ private void initControlView() {

addControlComponent(
videoTitleView,
videoSettingView,
bottomControlView,
videoSettingView,
videoCompleteView,
errorView,
prepareView,
Expand Down Expand Up @@ -264,13 +271,13 @@ public void onPlayerStateChanged(int playerState) {
int dp24 = PlayerUtils.dp2px(getContext(), 24);
int cutoutHeight = getCutoutHeight();
if (orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
FrameLayout.LayoutParams lblp = (LayoutParams) lockImgView.getLayoutParams();
RelativeLayout.LayoutParams lblp = (RelativeLayout.LayoutParams) lockImgView.getLayoutParams();
lblp.setMargins(dp24, 0, dp24, 0);
} else if (orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
FrameLayout.LayoutParams layoutParams = (LayoutParams) lockImgView.getLayoutParams();
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) lockImgView.getLayoutParams();
layoutParams.setMargins(dp24 + cutoutHeight, 0, dp24 + cutoutHeight, 0);
} else if (orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE) {
FrameLayout.LayoutParams layoutParams = (LayoutParams) lockImgView.getLayoutParams();
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) lockImgView.getLayoutParams();
layoutParams.setMargins(dp24, 0, dp24, 0);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,7 @@ public void onLockStateChanged(boolean isLocked) {
public void onClick(View v) {
int id = v.getId();
if (id == R.id.iv_play) {
if (playCompleted) {
mControlWrapper.replay(true);
//danmakuView.restart();
danmakuView.show();
danmakuView.seekTo((long) 0);
} else {
mControlWrapper.togglePlay();
danmakuView.toggle();
}

pressPlayBtn();
} else if (id == R.id.iv_barrage) {
if (danmakuView.isShown()) {
danmakuView.hide();
Expand All @@ -347,6 +338,18 @@ public void onClick(View v) {
}
}

public void pressPlayBtn() {
if (playCompleted) {
mControlWrapper.replay(true);
//danmakuView.restart();
danmakuView.show();
danmakuView.seekTo((long) 0);
} else {
mControlWrapper.togglePlay();
danmakuView.toggle();
}
}

/**
* 进度条组件进度改变监听
*
Expand Down
Loading

0 comments on commit e57a24d

Please sign in to comment.