|
@@ -539,14 +539,13 @@ export struct LocalMusic {
|
|
|
this.doChangeBarHeight()
|
|
this.doChangeBarHeight()
|
|
|
let viewWidth = px2vp(size.width);
|
|
let viewWidth = px2vp(size.width);
|
|
|
let viewHeight = px2vp(size.height);
|
|
let viewHeight = px2vp(size.height);
|
|
|
- if (viewWidth > viewHeight) {
|
|
|
|
|
- this.isLandscape = true;
|
|
|
|
|
|
|
+ if(this.isPhoneLan()){
|
|
|
|
|
+ this.is_auto_hide_progress = false
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.is_auto_hide_progress = true
|
|
|
|
|
+ }, 6000)
|
|
|
|
|
+ }else{
|
|
|
this.startAutoHide()
|
|
this.startAutoHide()
|
|
|
- // Logger.info('onecold 横屏 windowSizeChange isLandscape = ' + this.isLandscape)
|
|
|
|
|
- } else {
|
|
|
|
|
- this.isLandscape = false;
|
|
|
|
|
- this.isAutoHide = false
|
|
|
|
|
- // Logger.info('onecold 竖屏 windowSizeChange isLandscape = ' + this.isLandscape)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
});
|
|
});
|
|
@@ -560,9 +559,12 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
startAutoHide() {
|
|
startAutoHide() {
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.isAutoHide = true
|
|
|
|
|
- }, 4000)
|
|
|
|
|
|
|
+ if(PreferencesUtil.getBooleanSync(SettingPage.IS_AUTO_HIDE_PROGRESS,false)){
|
|
|
|
|
+ this.is_auto_hide_progress = false
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.is_auto_hide_progress = true
|
|
|
|
|
+ }, 6000)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
applyThemeMode(mode: number) {
|
|
applyThemeMode(mode: number) {
|
|
@@ -4399,9 +4401,6 @@ export struct LocalMusic {
|
|
|
LogUtil.info('this.currentSong.sampleRate =' + this.currentSong.sampleRate)
|
|
LogUtil.info('this.currentSong.sampleRate =' + this.currentSong.sampleRate)
|
|
|
LogUtil.info('this.currentSongmimeType =' + this.currentSong.mimeType)
|
|
LogUtil.info('this.currentSongmimeType =' + this.currentSong.mimeType)
|
|
|
this.startPlayOrResumePlay()
|
|
this.startPlayOrResumePlay()
|
|
|
- // let outputPath = this.videoUrl.substring(0, this.videoUrl.lastIndexOf('.')) + '.json'
|
|
|
|
|
- // this.readCoverInfo(this.videoUrl,outputPath)
|
|
|
|
|
- // this.readMediaInfo(this.videoUrl)
|
|
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -4409,33 +4408,6 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // readCoverInfo(inputPath:string,outputPath:string){
|
|
|
|
|
- // console.info("onecold FFmpeg inputPath = "+inputPath);
|
|
|
|
|
- // console.info("onecold FFmpeg outputPath = "+outputPath);
|
|
|
|
|
- // let commands = ["ffmpeg", "-i", inputPath, "-f ffmetadata",outputPath];
|
|
|
|
|
- // FFmpeg.execute(commands, {
|
|
|
|
|
- // logCallback: (logLevel: number, logMessage: string) => console.log(`[${logLevel}]${logMessage}`),
|
|
|
|
|
- // progressCallback: (message: string) => console.log(`[onecold FFmpeg progress]${JSON.stringify(FFProgressMessageParser.parse(message))}`),
|
|
|
|
|
- // }).then(() => {
|
|
|
|
|
- // console.info("onecold FFmpeg execution succeeded.");
|
|
|
|
|
- // }).catch((error: Error) => {
|
|
|
|
|
- // console.error(`onecold FFmpeg execution failed with error: ${error.message}`);
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // readMediaInfo(inputPath:string){
|
|
|
|
|
- // let commands = ["ffprobe", "-v", "info", "-of", "json", "-show_entries", "stream=sample_rate,bit_rate", "-i", inputPath];
|
|
|
|
|
- // let outputJson = "";
|
|
|
|
|
- // FFmpeg.execute(commands, {
|
|
|
|
|
- // logCallback: (logLevel: number, logMessage: string) => console.log(`[${logLevel}]${logMessage}`),
|
|
|
|
|
- // outputCallback: (message: string) => { outputJson += message; },
|
|
|
|
|
- // }).then(() => {
|
|
|
|
|
- // console.info(`Execution succeeded with output: ${outputJson}`);
|
|
|
|
|
- // }).catch((error: Error) => {
|
|
|
|
|
- // console.error(`Execution failed with error: ${error.message}`);
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
|
|
|
|
|
@Builder
|
|
@Builder
|
|
|
PlayController() {
|
|
PlayController() {
|
|
@@ -4475,6 +4447,8 @@ export struct LocalMusic {
|
|
|
this.isShowPlay = true;
|
|
this.isShowPlay = true;
|
|
|
let lyricPath = this.videoUrl.substring(0, this.videoUrl.lastIndexOf('.')) + '.lrc'
|
|
let lyricPath = this.videoUrl.substring(0, this.videoUrl.lastIndexOf('.')) + '.lrc'
|
|
|
this.initLyric(lyricPath);
|
|
this.initLyric(lyricPath);
|
|
|
|
|
+ this.startAutoHide()
|
|
|
|
|
+
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
|
|
ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
|
|
@@ -6040,7 +6014,6 @@ export struct LocalMusic {
|
|
|
.backgroundBrightness({ rate: this.isPuraWP() ? 0.1 : 0, lightUpDegree: -0.1 })
|
|
.backgroundBrightness({ rate: this.isPuraWP() ? 0.1 : 0, lightUpDegree: -0.1 })
|
|
|
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
|
|
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
- this.isAutoHide = false
|
|
|
|
|
this.startAutoHide()
|
|
this.startAutoHide()
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -6136,7 +6109,7 @@ export struct LocalMusic {
|
|
|
/**
|
|
/**
|
|
|
* 初始化歌词加载与展示逻辑
|
|
* 初始化歌词加载与展示逻辑
|
|
|
* @param lyricPath 歌词文件路径(支持普通.lrc和加密.lrcc)
|
|
* @param lyricPath 歌词文件路径(支持普通.lrc和加密.lrcc)
|
|
|
- * @param isToast 是否弹出Toast提示(可选)获取在线歌词为true
|
|
|
|
|
|
|
+ * @param isOnLineAndToast 是否弹出Toast提示(可选)获取在线歌词为true
|
|
|
* @param isApi2 是否使用API2获取歌词(可选)
|
|
* @param isApi2 是否使用API2获取歌词(可选)
|
|
|
*
|
|
*
|
|
|
* 主要流程:
|
|
* 主要流程:
|
|
@@ -6152,7 +6125,7 @@ export struct LocalMusic {
|
|
|
* - 支持加密歌词文件(.lrcc),自动检测并解密。
|
|
* - 支持加密歌词文件(.lrcc),自动检测并解密。
|
|
|
* - 歌词内容解析后通过lyricController驱动UI渲染。
|
|
* - 歌词内容解析后通过lyricController驱动UI渲染。
|
|
|
*/
|
|
*/
|
|
|
- async initLyric(lyricPath: string, isToast?: boolean, isApi2?: boolean) {
|
|
|
|
|
|
|
+ async initLyric(lyricPath: string, isOnLineAndToast?: boolean, isApi2?: boolean) {
|
|
|
if (StrUtil.isEmpty(lyricPath)) {
|
|
if (StrUtil.isEmpty(lyricPath)) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -6195,11 +6168,16 @@ export struct LocalMusic {
|
|
|
this.lyricController.setLyric(null)
|
|
this.lyricController.setLyric(null)
|
|
|
this.lyricControllerSingle.setLyric(null)
|
|
this.lyricControllerSingle.setLyric(null)
|
|
|
let jiaMilyricPath = lyricPath.substring(0, lyricPath.lastIndexOf('.')) + '.lrcc'
|
|
let jiaMilyricPath = lyricPath.substring(0, lyricPath.lastIndexOf('.')) + '.lrcc'
|
|
|
- LogUtil.debug("onecold lyricPath =" + lyricPath)
|
|
|
|
|
-
|
|
|
|
|
- const neiqianLrc = LrcParser.getLyrics(this.videoUrl); //获取内嵌歌词
|
|
|
|
|
- if (StrUtil.isNotEmpty(neiqianLrc) && !isToast) {
|
|
|
|
|
- LogUtil.debug("onecold 找到内嵌歌词 neiqianLrc =" + neiqianLrc)
|
|
|
|
|
|
|
+ console.log("onecold lyricPath =" + lyricPath)
|
|
|
|
|
+ let neiqianLrc = ''
|
|
|
|
|
+ let lyContent = this.currentSong?.lyricContent
|
|
|
|
|
+ if(lyContent&&StrUtil.isNotEmpty(lyContent)){//取数据库里面的歌词lyContent
|
|
|
|
|
+ neiqianLrc = lyContent
|
|
|
|
|
+ }else{
|
|
|
|
|
+ neiqianLrc = LrcParser.getLyrics(this.videoUrl); //获取内嵌歌词
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StrUtil.isNotEmpty(neiqianLrc) && !isOnLineAndToast) {
|
|
|
|
|
+ console.log("onecold 找到内嵌歌词 neiqianLrc =" + neiqianLrc)
|
|
|
//赋值给this.lyricContent,播控中心才可以显示歌词
|
|
//赋值给this.lyricContent,播控中心才可以显示歌词
|
|
|
this.lyricContent = neiqianLrc
|
|
this.lyricContent = neiqianLrc
|
|
|
// 将文件内容按行分割成字符串数组
|
|
// 将文件内容按行分割成字符串数组
|
|
@@ -6215,7 +6193,7 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (isToast || ((!FileUtil.accessSync(lyricPath) && !FileUtil.accessSync(jiaMilyricPath))
|
|
|
|
|
|
|
+ if (isOnLineAndToast || ((!FileUtil.accessSync(lyricPath) && !FileUtil.accessSync(jiaMilyricPath))
|
|
|
&& !Utility.isVideoByExtension(this.videoUrl))) {
|
|
&& !Utility.isVideoByExtension(this.videoUrl))) {
|
|
|
if (this.currentSong !== undefined) {
|
|
if (this.currentSong !== undefined) {
|
|
|
// ToastUtil.showShort('正在为你搜索在线歌词!')
|
|
// ToastUtil.showShort('正在为你搜索在线歌词!')
|
|
@@ -6264,7 +6242,7 @@ export struct LocalMusic {
|
|
|
this.lyricController.setLyric(null)
|
|
this.lyricController.setLyric(null)
|
|
|
this.lyricControllerXF.setLyric(null)
|
|
this.lyricControllerXF.setLyric(null)
|
|
|
this.lyricControllerSingle.setLyric(null)
|
|
this.lyricControllerSingle.setLyric(null)
|
|
|
- if (isToast) {
|
|
|
|
|
|
|
+ if (isOnLineAndToast) {
|
|
|
ToastUtil.showShort('未获取到歌词!')
|
|
ToastUtil.showShort('未获取到歌词!')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -6274,7 +6252,7 @@ export struct LocalMusic {
|
|
|
this.lyricController.setLyric(null)
|
|
this.lyricController.setLyric(null)
|
|
|
this.lyricControllerXF.setLyric(null)
|
|
this.lyricControllerXF.setLyric(null)
|
|
|
this.lyricControllerSingle.setLyric(null)
|
|
this.lyricControllerSingle.setLyric(null)
|
|
|
- if (isToast) {
|
|
|
|
|
|
|
+ if (isOnLineAndToast) {
|
|
|
ToastUtil.showShort('未获取到歌词!')
|
|
ToastUtil.showShort('未获取到歌词!')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -6285,7 +6263,7 @@ export struct LocalMusic {
|
|
|
this.lyricController.setLyric(null)
|
|
this.lyricController.setLyric(null)
|
|
|
this.lyricControllerXF.setLyric(null)
|
|
this.lyricControllerXF.setLyric(null)
|
|
|
this.lyricControllerSingle.setLyric(null)
|
|
this.lyricControllerSingle.setLyric(null)
|
|
|
- if (isToast) {
|
|
|
|
|
|
|
+ if (isOnLineAndToast) {
|
|
|
ToastUtil.showShort('未获取到歌词!')
|
|
ToastUtil.showShort('未获取到歌词!')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -6961,7 +6939,7 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .visibility(this.isPhoneLan() && this.isAutoHide ? Visibility.None : Visibility.Visible)
|
|
|
|
|
|
|
+ .visibility(this.is_auto_hide_progress ? Visibility.None : Visibility.Visible)
|
|
|
.animation({
|
|
.animation({
|
|
|
duration: 666,
|
|
duration: 666,
|
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
@@ -7036,7 +7014,7 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- .visibility(this.isPhoneLan() && this.isAutoHide ? Visibility.None : Visibility.Visible)
|
|
|
|
|
|
|
+ .visibility( this.is_auto_hide_progress ? Visibility.None : Visibility.Visible)
|
|
|
.animation({
|
|
.animation({
|
|
|
duration: 666,
|
|
duration: 666,
|
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
@@ -7061,7 +7039,6 @@ export struct LocalMusic {
|
|
|
.width(this.isPhonePortrait() ? '93.4%'
|
|
.width(this.isPhonePortrait() ? '93.4%'
|
|
|
: this.currentHeightBreakpoint == 1 && this.currentWidthBreakpoint == 2 ? '99%' : '82%')
|
|
: this.currentHeightBreakpoint == 1 && this.currentWidthBreakpoint == 2 ? '99%' : '82%')
|
|
|
.height(this.isPhoneLan() ? 25 : 33)
|
|
.height(this.isPhoneLan() ? 25 : 33)
|
|
|
- // .visibility(this.isPhoneLan()&&this.isAutoHide?Visibility.None:Visibility.Visible)
|
|
|
|
|
.animation({
|
|
.animation({
|
|
|
duration: 666,
|
|
duration: 666,
|
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
@@ -7084,7 +7061,7 @@ export struct LocalMusic {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @State isAutoHide: boolean = true //手机横屏自动隐藏播放进退条,点击屏幕可以显示,倒计时4秒后又自动隐藏
|
|
|
|
|
|
|
+ @State is_auto_hide_progress: boolean = false //手机横屏自动隐藏播放进退条,点击屏幕可以显示,倒计时4秒后又自动隐藏
|
|
|
@State isCoverRectangle: boolean = false
|
|
@State isCoverRectangle: boolean = false
|
|
|
@State isCoverTop: boolean = true
|
|
@State isCoverTop: boolean = true
|
|
|
|
|
|
|
@@ -9447,6 +9424,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
|
|
|
|
|
let lyricPath = this.videoUrl.substring(0, this.videoUrl.lastIndexOf('.')) + '.lrc'
|
|
let lyricPath = this.videoUrl.substring(0, this.videoUrl.lastIndexOf('.')) + '.lrc'
|
|
|
|
|
+
|
|
|
await this.initLyric(lyricPath);
|
|
await this.initLyric(lyricPath);
|
|
|
|
|
|
|
|
|
|
|