コード例 #1
0
ファイル: SYMM.cs プロジェクト: Kimmax/SYMM
        public void DownloadVideoNonBlocking(IYouTubeVideo video, ISYMMSettings settings)
        {
            VideoDownloader downloader = new VideoDownloader(video);
            downloader.DownloadProgressChanged += (s, e) =>
            {
                if (OnVideoDownloadProgressChanged != null)
                    OnVideoDownloadProgressChanged(this, e);
            };

            downloader.AudioExtractionProgressChanged += (s, e) =>
            {
                if (OnVideoAudioExtractionProgressChanged != null)
                    OnVideoAudioExtractionProgressChanged(this, e);
            };

            downloader.VideoDownloadComplete += (s, e) =>
            {
                if (OnVideoDownloadComplete != null)
                    OnVideoDownloadComplete(this, e);
            };

            downloader.VideoDownloadFailed += (s, e) =>
            {
                if (OnVideoDownloadFailed != null)
                    OnVideoDownloadFailed(this, e);
            };

            new Thread(() => { downloader.Execute(settings); }).Start();
        }
コード例 #2
0
ファイル: SYMM.cs プロジェクト: Kimmax/SYMM
        public void Execute(IYouTubeVideo video, ISYMMSettings settings)
        {
            VideoDownloader downloader = new VideoDownloader(video);
            downloader.DownloadProgressChanged += (s, e) =>
            {
                if (OnVideoDownloadProgressChanged != null)
                    OnVideoDownloadProgressChanged(this, e);
            };

            downloader.AudioExtractionProgressChanged += (s, e) =>
            {
                if (OnVideoAudioExtractionProgressChanged != null)
                    OnVideoAudioExtractionProgressChanged(this, e);
            };

            downloader.VideoDownloadComplete += (s, e) =>
            {
                if (OnVideoDownloadComplete != null)
                    OnVideoDownloadComplete(this, e);
            };

            downloader.VideoDownloadFailed += (s, e) =>
            {
                if (OnVideoDownloadFailed != null)
                    OnVideoDownloadFailed(this, e);
            };

            downloader.StreamPositionChanged += (s, e) =>
            {
                if (OnStreamPostionChanged != null)
                    OnStreamPostionChanged(this, e);
            };

            downloader.StreamFinished += (s, e) =>
            {
                if (OnStreamComplete != null)
                    OnStreamComplete(this, e);
            };

            downloader.Execute(settings);
            downloader = null;
        }