Example #1
0
        public async Task ClipAndUpload(string originalFile, string clipName, int start, int end,
                                        IProgress <EncodeProgress> encodeProgress, IProgress <UploadProgress> uploadProgress,
                                        CancellationToken cancelToken)
        {
            var outputFile = Path.GetTempFileName();

            try
            {
                await _encoder.Encode(originalFile, outputFile, start, end, encodeProgress, cancelToken);

                await _uploader.UploadFile(outputFile, clipName, uploadProgress, cancelToken);
            }
            finally
            {
                try
                {
                    File.Delete(outputFile);
                }
                // ReSharper disable once EmptyGeneralCatchClause
                catch
                {
                }
            }
        }