|
|
@@ -37,7 +37,7 @@ import { ColorConversion } from '../common/util/ColorConversion';
|
|
|
import { LyricController, LyricParser, LyricView2 } from '@seagazer/cclyric';
|
|
|
import { AvSessionController } from '../controller/AvSessionController';
|
|
|
import {
|
|
|
-// DeviceChangeReason,
|
|
|
+ // DeviceChangeReason,
|
|
|
IjkMediaPlayer,
|
|
|
InterruptEvent,
|
|
|
InterruptHintType,
|
|
|
@@ -884,11 +884,11 @@ export struct LocalMusic {
|
|
|
}
|
|
|
this.isCanBack = false
|
|
|
this.currentPath = curPath
|
|
|
- this.titleBarModel.setTitleName(Utility.getFileDirName(this.currentPath, this.rootPath))
|
|
|
+ this.titleBarModel.setTitleName(getFileDirName(this.currentPath, this.rootPath))
|
|
|
if (curPath === this.rootPath) {
|
|
|
this.titleBarModel.setLeftIconMain($r('app.media.menu'))
|
|
|
} else {
|
|
|
- this.currentTitleName = Utility.getFileDirName(this.currentPath, this.rootPath)
|
|
|
+ this.currentTitleName = getFileDirName(this.currentPath, this.rootPath)
|
|
|
if (this.rootPath === Utility.getParentDirectory(curPath)) {
|
|
|
this.titleBarModel.setLeftIconMain($r('app.media.left_back_white'))
|
|
|
}
|
|
|
@@ -2589,7 +2589,7 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Column(){
|
|
|
Text(item.md5Str?.includes('Lossless')?
|
|
|
- Utility.resourceToString(this.context,$r('app.string.lossless')):item.md5Str)//音质
|
|
|
+ Utility.resourceToString(this.context,$r('app.string.lossless')):item.md5Str)//音质
|
|
|
.fontSize(this.twoFingerType == 1 ? 8 : this.twoFingerType == 2 ? 9 : 11)
|
|
|
.padding({ top: 3,right:6,left:6,bottom:3 })
|
|
|
.fontColor(this.currentSong?.filePath === item.filePath ? this.themeColor :
|
|
|
@@ -2867,7 +2867,7 @@ export struct LocalMusic {
|
|
|
.padding({ top: 8 })
|
|
|
.maxLines(1)
|
|
|
.visibility(StrUtil.isEmpty(this.videoLocalList[0].year)||
|
|
|
- this.videoLocalList[0].year.includes(this.UNKONWN)
|
|
|
+ this.videoLocalList[0].year.includes(this.UNKONWN)
|
|
|
?Visibility.None:Visibility.Visible)
|
|
|
.fontWeight(FontWeight.Bold)
|
|
|
.fontColor($r('app.color.text_color'))
|
|
|
@@ -3503,7 +3503,7 @@ export struct LocalMusic {
|
|
|
.layoutWeight(1)
|
|
|
.scrollBar(BarState.Off)
|
|
|
.supportAnimation(true)
|
|
|
- .cachedCount(3)
|
|
|
+ .cachedCount(this.twoFingerType==1?5:this.twoFingerType==2?4:3)
|
|
|
// .columnsTemplate('1fr '.repeat(this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_SM ? 2 : 5))
|
|
|
.columnsTemplate(
|
|
|
this.twoFingerType == 3 ? 'repeat(auto-fit, 160)' :
|
|
|
@@ -3533,7 +3533,7 @@ export struct LocalMusic {
|
|
|
// if (this.isPhoneLan()) {
|
|
|
// this.setBarHeightHide(offset)
|
|
|
// } else
|
|
|
- if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
|
+ if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
|
(this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
|
|
|
this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
|
|
|
if (this.isScrollHide) {
|
|
|
@@ -3562,7 +3562,7 @@ export struct LocalMusic {
|
|
|
records[i].getEntry(uniformTypeDescriptor.UniformDataType.FILE_URI) as uniformDataStruct.FileUri;
|
|
|
let typeDescriptor = uniformTypeDescriptor.getTypeDescriptor(fileUriUds.fileType);
|
|
|
if (typeDescriptor.belongsTo(uniformTypeDescriptor.UniformDataType.AUDIO)
|
|
|
- ||typeDescriptor.belongsTo(uniformTypeDescriptor.UniformDataType.VIDEO)) {
|
|
|
+ ||typeDescriptor.belongsTo(uniformTypeDescriptor.UniformDataType.VIDEO)) {
|
|
|
this.targetFile = fileUriUds.oriUri;
|
|
|
this.saveVideoDatas([this.targetFile])
|
|
|
hilog.info(0x0000, 'Heanup', '当前targetFile:' + this.targetFile);
|
|
|
@@ -3628,8 +3628,8 @@ export struct LocalMusic {
|
|
|
})
|
|
|
.draggable(false)
|
|
|
.opacity(this.opacityItem)// 绑定透明度
|
|
|
- // .transition(TransitionEffect.move(TransitionEdge.BOTTOM)
|
|
|
- // .animation({ duration: 500, curve: Curve.Ease }))
|
|
|
+ // .transition(TransitionEffect.move(TransitionEdge.BOTTOM)
|
|
|
+ // .animation({ duration: 500, curve: Curve.Ease }))
|
|
|
.animation({
|
|
|
duration: 666,
|
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
|
@@ -3677,7 +3677,7 @@ export struct LocalMusic {
|
|
|
}
|
|
|
.margin({ top: 2 ,right:6})
|
|
|
.visibility((this.modeType == 3 && !this.isCanBack)||(this.modeType == 2 && !this.isCanBack)
|
|
|
- ||(this.modeType == 0&&item.type==CommonConstants.TYPE_IS_DIR)? Visibility.None : Visibility.Visible)
|
|
|
+ ||(this.modeType == 0&&item.type==CommonConstants.TYPE_IS_DIR)? Visibility.None : Visibility.Visible)
|
|
|
Text(StrUtil.isEmpty(item.artist) ? item.duration: item.artist)
|
|
|
.fontSize(11)
|
|
|
.fontSize(this.twoFingerType == 1 ? 10 : this.twoFingerType == 2 ? 12 : 14)
|
|
|
@@ -4180,7 +4180,7 @@ export struct LocalMusic {
|
|
|
// if (this.isPhoneLan()) {
|
|
|
// this.setBarHeightHide(offset)
|
|
|
// } else
|
|
|
- if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
|
+ if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
|
(this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
|
|
|
this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
|
|
|
if (this.isScrollHide) {
|
|
|
@@ -4197,7 +4197,7 @@ export struct LocalMusic {
|
|
|
return { offsetRemain: offset };
|
|
|
})
|
|
|
|
|
|
- //拖拽pc或者pad的用鼠标拖拽音乐和视频到List或Grid上自动导入视频
|
|
|
+ //拖拽pc或者pad的用鼠标拖拽音乐和视频到List或Grid上自动导入视频
|
|
|
.allowDrop([uniformTypeDescriptor.UniformDataType.AUDIO,uniformTypeDescriptor.UniformDataType.VIDEO])
|
|
|
.onDrop((event?: DragEvent) => {
|
|
|
try {
|
|
|
@@ -5857,13 +5857,13 @@ export struct LocalMusic {
|
|
|
// 使用更低的阈值和滑动速度判断
|
|
|
const minDistance = 100; // 最小滑动距离 100vp
|
|
|
const minVelocity = 500; // 最小滑动速度
|
|
|
-
|
|
|
+
|
|
|
// 获取滑动速度(如果可用)
|
|
|
const velocity = event?.velocityY || 0;
|
|
|
-
|
|
|
+
|
|
|
// 判断是否应该关闭:距离足够 或者 速度足够快
|
|
|
const shouldClose = this.translateY > minDistance || velocity > minVelocity;
|
|
|
-
|
|
|
+
|
|
|
if (shouldClose) {
|
|
|
// 添加关闭动画
|
|
|
this.getUIContext().animateTo({
|
|
|
@@ -6370,7 +6370,7 @@ export struct LocalMusic {
|
|
|
let neiqianLrc = ''
|
|
|
let lyContent = this.currentSong?.lyricContent
|
|
|
if(lyContent&&StrUtil.isNotEmpty(lyContent)){//取数据库里面的歌词lyContent
|
|
|
- neiqianLrc = lyContent
|
|
|
+ neiqianLrc = lyContent
|
|
|
}
|
|
|
if (StrUtil.isNotEmpty(neiqianLrc) && !isOnLineAndToast) {
|
|
|
console.log("onecold 找到内嵌歌词 neiqianLrc =" + neiqianLrc)
|
|
|
@@ -9541,10 +9541,16 @@ export struct LocalMusic {
|
|
|
this.mIjkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "enable-accurate-seek", "1");
|
|
|
|
|
|
const fileSize = await this.getFileSize(this.videoUrl);
|
|
|
- let bufferSize = 1 * 1024 * 1024; // 默认缓冲区大小为2MB
|
|
|
+ let bufferSize = 1 * 1024 ; // 默认缓冲区大小为1MB
|
|
|
if (fileSize > 3 * 1024 * 1024 * 1024) { // 文件大于3GB
|
|
|
bufferSize = 25 * 1024 * 1024; // 设置缓冲区大小为25MB
|
|
|
}
|
|
|
+ // 使用软件解码(通常比硬件解码更节省内存)
|
|
|
+ // this.mIjkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec", '0');
|
|
|
+ // this.mIjkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-auto-rotate", '0');
|
|
|
+ // this.mIjkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-handle-resolution-change", '0');
|
|
|
+ // this.mIjkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "probesize", '1024');
|
|
|
+ // this.mIjkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "analyzeduration", '500000');
|
|
|
|
|
|
//预读数据的缓冲区大小.修复大文件播放前几秒挂掉的bug,太大了会导致倍数播放失效
|
|
|
this.mIjkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "max-buffer-size", bufferSize + '');
|
|
|
@@ -11139,3 +11145,18 @@ function cutPopupBuilder(dataBu: BubbleBean) {
|
|
|
}
|
|
|
|
|
|
|
|
|
+function getFileDirName(filePath: string,rootPath:string): string{
|
|
|
+ if(filePath===rootPath){
|
|
|
+ return '首页'
|
|
|
+ }
|
|
|
+ let result = FileUtil.getFileName(filePath)
|
|
|
+ if(StrUtil.isEmpty(result))
|
|
|
+ return ''
|
|
|
+
|
|
|
+
|
|
|
+ if(result.startsWith('.'))
|
|
|
+ result = result.replace(/\./g, '')
|
|
|
+ return result
|
|
|
+}
|
|
|
+
|
|
|
+
|