Commit a43a634 1 parent a8a96ab commit a43a634 Copy full SHA for a43a634
File tree 1 file changed +1
-10
lines changed
1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,6 @@ export const audio = (() => {
12
12
*/
13
13
let audioEl = null ;
14
14
15
- /**
16
- * @type {Promise<void>|null }
17
- */
18
- let canPlay = null ;
19
-
20
15
let isPlay = false ;
21
16
22
17
const statePlay = '<i class="fa-solid fa-circle-pause spin-button"></i>' ;
@@ -30,8 +25,6 @@ export const audio = (() => {
30
25
return ;
31
26
}
32
27
33
- await canPlay ;
34
-
35
28
music . disabled = true ;
36
29
try {
37
30
await audioEl . play ( ) ;
@@ -69,8 +62,6 @@ export const audio = (() => {
69
62
audioEl . autoplay = false ;
70
63
audioEl . controls = false ;
71
64
72
- canPlay = new Promise ( ( res ) => audioEl . addEventListener ( 'canplay' , res , { once : true } ) ) ;
73
-
74
65
const context = new AudioContext ( ) ;
75
66
const source = context . createMediaElementSource ( audioEl ) ;
76
67
source . connect ( context . destination ) ;
@@ -86,8 +77,8 @@ export const audio = (() => {
86
77
return ;
87
78
}
88
79
89
- sourceBuffer . appendBuffer ( value . buffer ) ;
90
80
sourceBuffer . addEventListener ( 'updateend' , push , { once : true } ) ;
81
+ sourceBuffer . appendBuffer ( value . buffer ) ;
91
82
} ) ;
92
83
93
84
push ( ) ;
You can’t perform that action at this time.
0 commit comments