mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 03:13:51 +02:00
Add Logging singleton to manually control Mediabunny's console output (fixes #415)
This commit is contained in:
+4
-3
@@ -23,6 +23,7 @@ import {
|
||||
} from './encode';
|
||||
import { Input } from './input';
|
||||
import { InputAudioTrack, InputTrack, InputVideoTrack } from './input-track';
|
||||
import { Logging } from './logging';
|
||||
import {
|
||||
AudioSampleSink,
|
||||
EncodedPacketSink,
|
||||
@@ -958,7 +959,7 @@ export class Conversion {
|
||||
}
|
||||
|
||||
if (warnElements.length > 0) {
|
||||
console.warn(...warnElements);
|
||||
Logging._warn(...warnElements);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1122,7 +1123,7 @@ export class Conversion {
|
||||
}
|
||||
|
||||
if (this._canceled) {
|
||||
console.warn('Conversion already canceled.');
|
||||
Logging._warn('Conversion already canceled.');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1327,7 +1328,7 @@ export class Conversion {
|
||||
firstSample.close();
|
||||
await tempOutput.finalize();
|
||||
} catch (error) {
|
||||
console.info('Error when probing encoder support. Falling back to rerender path.', error);
|
||||
Logging._info('Error when probing encoder support. Falling back to rerender path.', error);
|
||||
needsRerender = true;
|
||||
void tempOutput.cancel();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user