Skip to content

Commit

Permalink
fix(play): 调整配置
Browse files Browse the repository at this point in the history
  • Loading branch information
hesetiema committed May 28, 2024
1 parent 64b4807 commit 2a0ab25
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/views/admin/MusicPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const handleFiles = (event) => {
const file = files[0]
const reader = new FileReader()
reader.onload = () => {
audioRef.value.src = reader.result
if (typeof reader.result === 'string') {
audioRef.value.src = reader.result
}
}
if (file) {
Expand All @@ -34,7 +36,7 @@ const handleFiles = (event) => {
}
function onLoadAudio() {
const context = new (window.AudioContext || window.webkitAudioContext)()
const context = new window.AudioContext()
const analyser = context.createAnalyser()
analyser.fftSize = 512
const source = context.createMediaElementSource(audioRef.value)
Expand Down

0 comments on commit 2a0ab25

Please sign in to comment.