This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 6a8f21e authored Aug 18, 2024 Verified
1 parent 90236c2 commit 6a8f21e Copy full SHA for 6a8f21e
File tree 1 file changed +7
-3
lines changed
src/plugins/htmlAudioPlayer
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -124,13 +124,17 @@ class HtmlAudioPlayer {
124
124
}
125
125
126
126
if ( normalizationGain ) {
127
- self . gainNode . gain . value = Math . pow ( 10 , normalizationGain / 20 ) ;
128
- self . normalizationGain = self . gainNode . gain . value ;
127
+ self . normalizationGain = Math . pow ( 10 , normalizationGain / 20 ) ;
128
+ self . gainNode . gain . value = self . normalizationGain ;
129
129
} else {
130
130
self . gainNode . gain . value = 1 ;
131
131
self . normalizationGain = 1 ;
132
132
}
133
- console . debug ( 'gain: ' + self . gainNode . gain . value ) ;
133
+ if ( browser . safari ) {
134
+ // Gain value is absolute in Safari. Add volume from the slider
135
+ self . gainNode . gain . value *= elem . volume ;
136
+ }
137
+ console . debug ( 'gain: ' + self . normalizationGain ) ;
134
138
} ) . catch ( ( err ) => {
135
139
console . error ( 'Failed to add/change gainNode' , err ) ;
136
140
} ) ;
You can’t perform that action at this time.
0 commit comments