Inheritance: Core.Protocols.Rtmp.InboundRTMPProtocol, IDownload
示例#1
0
        private void DownloadVideo(object sender, RoutedEventArgs e)
        {
            var url = textBox.Text;

            Settings.Default.LastURL = url;
            Settings.Default.Save();
            IDownload download = null;
            var       dialog   = new SaveFileDialog()
            {
                CheckFileExists = false, AddExtension = true, OverwritePrompt = true, CreatePrompt = false, CheckPathExists = false, DefaultExt = ".flv",
                Filter          = "Flash 视频|*.flv" // Filter files by extension
            };

            if (dialog.ShowDialog(this) != true)
            {
                return;
            }

            if (url.StartsWith("rtmp://"))
            {
                download = new RtmpDownload();
                download.Start(url, dialog.FileName);
            }
            else if (url.StartsWith("rtmfp://"))
            {
                download = new DownloadProtocol();
                download.Start(url, dialog.FileName);
            }

            Settings.Default.DowloadHistory.Add(url);
            Settings.Default.Save();
            DownloadList.Add(download);
            listBox.SelectedItem = download;
        }
示例#2
0
        private void StartDownload(object sender, RoutedEventArgs e)
        {
            var lines = textBox.Text.Split(new [] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var line in lines)
            {
                var       url      = line;
                IDownload download = null;
                if (url.StartsWith("rtmp://"))
                {
                    download = new RtmpDownload();
                    download.Start(url, null);
                }
                else if (url.StartsWith("rtmfp://"))
                {
                    download = new DownloadProtocol();
                    download.Start(url, null);
                }

                Settings.Default.DowloadHistory.Add(url);
                MainWindow.DownloadList.Add(download);
            }
            Settings.Default.Save();
            Close();
        }
        private void StartDownload(object sender, RoutedEventArgs e)
        {
            var lines = textBox.Text.Split(new [] { "\r\n" } ,StringSplitOptions.RemoveEmptyEntries);
            foreach (var line in lines)
            {
                var url = line;
                IDownload download = null;
                if (url.StartsWith("rtmp://"))
                {
                    download = new RtmpDownload();
                    download.Start(url,null);
                }
                else if (url.StartsWith("rtmfp://"))
                {
                    download = new DownloadProtocol();
                    download.Start(url,null);
                }

                Settings.Default.DowloadHistory.Add(url);
                MainWindow.DownloadList.Add(download);
            }
            Settings.Default.Save();
            Close();
        }
示例#4
0
 private void DownloadVideo(object sender, RoutedEventArgs e)
 {
     var url = textBox.Text;
     Settings.Default.LastURL = url;
     Settings.Default.Save();
     IDownload download = null;
     var dialog = new SaveFileDialog()
     {
         CheckFileExists = false,AddExtension = true,OverwritePrompt = true,CreatePrompt = false,CheckPathExists = false,DefaultExt = ".flv",
         Filter = "Flash 视频|*.flv" // Filter files by extension
     };
     if (dialog.ShowDialog(this) != true)
     {
         return;
     }
     
     if (url.StartsWith("rtmp://"))
     {
         download = new RtmpDownload();
         download.Start(url, dialog.FileName);
     }
     else if (url.StartsWith("rtmfp://"))
     {
         download = new DownloadProtocol();
         download.Start(url,dialog.FileName);
     }
     
     Settings.Default.DowloadHistory.Add(url);
     Settings.Default.Save();
     DownloadList.Add(download);
     listBox.SelectedItem = download;
 }