Update MediaPlayer.js
This commit is contained in:
@@ -74,6 +74,8 @@ 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));
|
||||||
|
|
||||||
|
// Check input
|
||||||
|
if (typeof input == 'string' && URL.canParse(input)) {
|
||||||
args.unshift(
|
args.unshift(
|
||||||
'-reconnect',
|
'-reconnect',
|
||||||
'1',
|
'1',
|
||||||
@@ -84,6 +86,7 @@ class MediaPlayer extends EventEmitter {
|
|||||||
'-reconnect_delay_max',
|
'-reconnect_delay_max',
|
||||||
'4294',
|
'4294',
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const ffmpeg = new prism.FFmpeg({ args });
|
const ffmpeg = new prism.FFmpeg({ args });
|
||||||
streams.ffmpeg = ffmpeg;
|
streams.ffmpeg = ffmpeg;
|
||||||
@@ -146,7 +149,8 @@ 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
|
||||||
|
if (typeof input == 'string' && URL.canParse(input)) {
|
||||||
args.unshift(
|
args.unshift(
|
||||||
'-reconnect',
|
'-reconnect',
|
||||||
'1',
|
'1',
|
||||||
@@ -157,6 +161,7 @@ class MediaPlayer extends EventEmitter {
|
|||||||
'-reconnect_delay_max',
|
'-reconnect_delay_max',
|
||||||
'4294',
|
'4294',
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Get stream type
|
// Get stream type
|
||||||
if (this.voiceConnection.videoCodec == 'VP8') {
|
if (this.voiceConnection.videoCodec == 'VP8') {
|
||||||
|
|||||||
Reference in New Issue
Block a user