Update MediaPlayer.js
This commit is contained in:
@@ -74,16 +74,19 @@ class MediaPlayer extends EventEmitter {
|
|||||||
const args = isStream ? FFMPEG_ARGUMENTS.slice() : ['-i', input, ...FFMPEG_ARGUMENTS];
|
const args = isStream ? FFMPEG_ARGUMENTS.slice() : ['-i', input, ...FFMPEG_ARGUMENTS];
|
||||||
if (options.seek) args.unshift('-ss', String(options.seek));
|
if (options.seek) args.unshift('-ss', String(options.seek));
|
||||||
|
|
||||||
args.unshift(
|
// Check input
|
||||||
'-reconnect',
|
if (typeof input == 'string' && URL.canParse(input)) {
|
||||||
'1',
|
args.unshift(
|
||||||
'-reconnect_at_eof',
|
'-reconnect',
|
||||||
'1',
|
'1',
|
||||||
'-reconnect_streamed',
|
'-reconnect_at_eof',
|
||||||
'1',
|
'1',
|
||||||
'-reconnect_delay_max',
|
'-reconnect_streamed',
|
||||||
'4294',
|
'1',
|
||||||
);
|
'-reconnect_delay_max',
|
||||||
|
'4294',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const ffmpeg = new prism.FFmpeg({ args });
|
const ffmpeg = new prism.FFmpeg({ args });
|
||||||
streams.ffmpeg = ffmpeg;
|
streams.ffmpeg = ffmpeg;
|
||||||
@@ -146,17 +149,19 @@ class MediaPlayer extends EventEmitter {
|
|||||||
|
|
||||||
if (options.seek) args.unshift('-ss', String(options.seek));
|
if (options.seek) args.unshift('-ss', String(options.seek));
|
||||||
|
|
||||||
// Fix connection
|
// Check input
|
||||||
args.unshift(
|
if (typeof input == 'string' && URL.canParse(input)) {
|
||||||
'-reconnect',
|
args.unshift(
|
||||||
'1',
|
'-reconnect',
|
||||||
'-reconnect_at_eof',
|
'1',
|
||||||
'1',
|
'-reconnect_at_eof',
|
||||||
'-reconnect_streamed',
|
'1',
|
||||||
'1',
|
'-reconnect_streamed',
|
||||||
'-reconnect_delay_max',
|
'1',
|
||||||
'4294',
|
'-reconnect_delay_max',
|
||||||
);
|
'4294',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Get stream type
|
// Get stream type
|
||||||
if (this.voiceConnection.videoCodec == 'VP8') {
|
if (this.voiceConnection.videoCodec == 'VP8') {
|
||||||
|
|||||||
Reference in New Issue
Block a user