Skip to content
This repository was archived by the owner on Aug 19, 2023. It is now read-only.

Commit 6591393

Browse files
committed
#17 新增了串流播放的开关
1 parent e1b8e03 commit 6591393

File tree

4 files changed

+41
-24
lines changed

4 files changed

+41
-24
lines changed

Diff for: src/App.vue

+25-21
Original file line numberDiff line numberDiff line change
@@ -1366,12 +1366,15 @@ import { transform } from '@vue/compiler-core'
13661366
13671367
if (transitionning != true) this.data.player.uiDisplay.progress = progress
13681368
1369+
let configSettingData = config.setting()
13691370
//音频过度事件触发
1370-
if (this.data.player.uiDisplay.duration - cur <= 1 && this.audio.duration > 0 && this.audio.readyState >=2 && this
1371-
.audio.loop != true)
1372-
this.transitionNextMusic()
1371+
let transitionTime = (configSettingData.config.useTransitionNextMusic == true )?6:1
1372+
if (((this.data.player.uiDisplay.duration - cur) <= transitionTime) && (progress != NaN) && (this.audio.readyState >=2) && (this
1373+
.audio.loop != true) && (transitionning == false)){this.transitionNextMusic(transitionTime)}
1374+
1375+
13731376
this.lyricSet()
1374-
if(config.setting().config.lyricSet.maxfps == false){
1377+
if(configSettingData.config.lyricSet.maxfps == false){
13751378
window.requestAnimationFrame(()=>this.getCurr())
13761379
} else {
13771380
setTimeout(() => this.getCurr(), 41)
@@ -1408,7 +1411,7 @@ import { transform } from '@vue/compiler-core'
14081411
if(!NextMusicCache||transitionning==true){return}
14091412
transitionning = true
14101413
newAudio.src = NextMusicCache.song[NextMusicCache.song.use].url;
1411-
newAudio.volume = this.state.volume
1414+
newAudio.volume = 0 //this.state.volume
14121415
newAudio.currentTime = 0
14131416
progress.load(newAudio)
14141417
//播放新的音频
@@ -1431,6 +1434,9 @@ import { transform } from '@vue/compiler-core'
14311434
},
14321435
14331436
})
1437+
1438+
1439+
14341440
setTimeout(() => {
14351441
transitionning = false
14361442
}, time / 10000 / this.data.player.uiDisplay.duration);
@@ -1444,21 +1450,19 @@ import { transform } from '@vue/compiler-core'
14441450
this.$refs.lyricBox.style.setProperty('--transform', '0px' )
14451451
this.data.player.trackNum = numb
14461452
this['audio'] = newAudio
1447-
let time = times || 1000 * (oldAudio.duration - oldAudio.currentTime);
1448-
1449-
// anime({
1450-
// targets: newAudio,
1451-
// duration: time,
1452-
// volume: 1 * this.state.volume,
1453-
// easing: 'linear'
1454-
// })
1455-
// anime({
1456-
// targets: oldAudio,
1457-
// duration: time,
1458-
// volume: 0,
1459-
// easing: 'linear'
1460-
// })
1461-
1453+
let time = times * 1000 || 1000 * (oldAudio.duration - oldAudio.currentTime);
1454+
anime({
1455+
targets: newAudio,
1456+
duration: time,
1457+
volume: 1 * this.state.volume,
1458+
easing: 'linear'
1459+
})
1460+
anime({
1461+
targets: oldAudio,
1462+
duration: time,
1463+
volume: 0,
1464+
easing: 'linear'
1465+
})
14621466
setTimeout(
14631467
() => {
14641468
@@ -1512,7 +1516,7 @@ import { transform } from '@vue/compiler-core'
15121516
15131517
},
15141518
nextMusic() {
1515-
1519+
// debugger
15161520
//上传听歌记录
15171521
15181522
this.data.player.uiDisplay.LineNum = 0

Diff for: src/js/audioNetease.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async function requireId(id) {
7070
netea: {},
7171
unblock: {},
7272
use: 'netea',
73-
functions:null
73+
functions:()=>{}
7474
},
7575
lyric: {},
7676
}

Diff for: src/js/config.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ import reTools from '../network/getData'
66
var setting = {
77
id: '0',
88
config: {
9-
configVersion: '1.5',
9+
configVersion: '1.6',
1010
lyricSet: {
1111
dur: 450,
1212
text: '最高',
1313
funcBlur: true,
1414
funcDelay: true,
1515
animeFontSize: false,
1616
maxfps: false
17+
18+
1719
},
18-
useAnimeBackground: false
20+
useAnimeBackground: false,
21+
useTransitionNextMusic: false
1922
}
2023
}
2124

Diff for: src/views/setting.vue

+10
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@
142142
this.upload()
143143
}
144144
}
145+
,
146+
useTransitionNextMusic:{
147+
text: '使用 5秒 的音乐串流切歌功能',
148+
type:'line',
149+
bolean: config.useTransitionNextMusic,
150+
func:(item)=>{
151+
config.useTransitionNextMusic = item.bolean
152+
this.upload()
153+
}
154+
}
145155
},
146156
config,
147157
cookie: '',

0 commit comments

Comments
 (0)