MediaToolkit.Standard/MediaToolkit.Standard/Extensions/ServiceCollectionExtensions.cs
/// <summary>
/// Adds the MediaToolkit to the service collection.
/// </summary>
Adds the MediaToolkit to the service collection.
Adds the MediaToolkit to the service collection .
public static IServiceCollection AddMediaToolkit(this IServiceCollection services, string ffmpegPath, string ffprobePath = null)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }
            var options = new MediaToolkitOptions
            {
                FfMpegPath = ffmpegPath
            };
            if (!string.IsNullOrEmpty(ffprobePath))
            {
                options.FfProbePath = ffprobePath;
            }
            services.TryAddSingleton<IFileSystem, FileSystem>();
            services.AddSingleton(options);
            services.AddSingleton<IFfProcessFactory, FfProcessFactory>();
            services.AddSingleton<IMediaToolkitService, MediaToolkitService>();
            return services;
        }
public static IServiceCollection AddMediaToolkit ( this IServiceCollection services , string ffmpegPath , string ffprobePath = null ) { if ( services == null ) { throw new ArgumentNullException ( nameof ( services ) ) ; } var options = new MediaToolkitOptions { FfMpegPath = ffmpegPath } ; if ( ! string . IsNullOrEmpty ( ffprobePath ) ) { options . FfProbePath = ffprobePath ; } services . TryAddSingleton < IFileSystem , FileSystem > ( ) ; services . AddSingleton ( options ) ; services . AddSingleton < IFfProcessFactory , FfProcessFactory > ( ) ; services . AddSingleton < IMediaToolkitService , MediaToolkitService > ( ) ; return services ; }
Adds the MediaToolkit to the service collection.
Adds the MediaToolkit to the service collection .
IServiceCollection
this
ffmpegPath
string
ffprobePath
string