Browse Source

解锁音频2

zhangyujun 3 years ago
parent
commit
e9eecbe03e
1 changed files with 2 additions and 7 deletions
  1. 2 7
      src/hooks/light/audio.ts

+ 2 - 7
src/hooks/light/audio.ts

@@ -19,13 +19,8 @@ export function useAudio() {
         pauseAudio()
         pauseAudio()
         sound = new Howl({
         sound = new Howl({
             src: url,
             src: url,
-            xhr: {
-                method: 'GET',
-                headers: {
-                    Authorization: 'Bearer:' + token,
-                },
-                withCredentials: true,
-            }
+            preload:false,
+            autoplay: true
         });
         });
         return new Promise((resolve, reject) => {
         return new Promise((resolve, reject) => {
             sound.on('unlock',()=>{
             sound.on('unlock',()=>{