feat: 音频缓存(支持离线)&音频代理

This commit is contained in:
lqtmcstudio
2026-02-04 10:30:28 +08:00
parent 935038cd93
commit d37f2e073e
5 changed files with 959 additions and 58 deletions

View File

@@ -41,7 +41,11 @@ export class MpvController extends EventEmitter {
'--force-window=no',
'--no-media-controls',
`--input-ipc-server=${this.ipcPath}`,
'--no-terminal'
'--no-terminal',
// Network cache for smooth playback (disk caching is handled by proxy)
'--cache=yes',
'--demuxer-max-bytes=50MiB',
'--demuxer-readahead-secs=30'
]);
this.process.on('error', (err) => {
@@ -82,7 +86,7 @@ export class MpvController extends EventEmitter {
this.handleData(data);
});
this.socket.on('error', (err) => {
this.socket.on('error', (_) => {
this.socket?.destroy();
this.tryConnect(retries - 1);
});