File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ function getContentType(file) {
21
21
}
22
22
23
23
function FilePlayer ( file , contentType ) {
24
- var output = new Audio ( ) ;
25
- if ( output . canPlayType ( contentType ) ) {
26
- output . src = URL . createObjectURL ( new Blob ( [ file ] , { type : contentType } ) ) ;
27
- output . play ( ) ;
24
+ var audio = this . audio = new Audio ( ) ;
25
+ if ( audio . canPlayType ( contentType ) ) {
26
+ audio . src = URL . createObjectURL ( new Blob ( [ file ] , { type : contentType } ) ) ;
27
+ audio . play ( ) ;
28
28
} else {
29
29
// if we emit an error, it prevents the promise from returning the actual result
30
30
// however, most browsers do not support flac, so this is a reasonably scenario
@@ -34,8 +34,8 @@ function FilePlayer(file, contentType) {
34
34
throw err ;
35
35
}
36
36
this . stop = function stop ( ) {
37
- output . pause ( ) ;
38
- output . currentTime = 0 ;
37
+ audio . pause ( ) ;
38
+ audio . currentTime = 0 ;
39
39
}
40
40
}
41
41
You can’t perform that action at this time.
0 commit comments