mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
Add volume change handling to ASR plugin
- Implemented an event listener for 'video:volumechange' to adjust the gain node's value based on the current volume of the artplayer instance. - This enhancement ensures that the audio processing reflects the user's volume adjustments in real-time.
This commit is contained in:
1 parent
826abd8c7d
commit
19756e8224
3 files changed
+10
-1
No files matched your search
@@ -256,6 +256,12 @@ export default function artplayerPluginAsr(option = {}) {
|
||||
workletLoaded = false;
|
||||
}
|
||||
|
||||
art.on('video:volumechange', () => {
|
||||
if (gainNode) {
|
||||
gainNode.gain.value = art.volume;
|
||||
}
|
||||
});
|
||||
|
||||
art.on('play', startCapture);
|
||||
art.on('pause', stopCapture);
|
||||
art.on('destroy', destroy);
|
||||
|
||||
Reference in new issue
Block a user