• 大小: 11.05MB
    文件类型: .rar
    金币: 2
    下载: 5 次
    发布日期: 2023-07-01
  • 语言: C#
  • 标签: RTMP  rtsp  c#  流媒体  直播  

资源简介

只要要用c#写个rtmp播放器,苦苦找不到资源,c#播放 RTMP,RTSP流媒体等源代码,特此分享,希望能帮助大家

资源截图

代码片段和文件信息

using System;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    using WebEye.Controls.WinForms.StreamPlayerControl;

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void playButton_Click(object sender EventArgs e)
        {
            var uri = new Uri(_urlTextBox.Text);
            streamPlayerControl1.StartPlay(uri);
            _statusTextBox.Text = “Connecting...“;
        }

        private void stopButton_Click(object sender EventArgs e)
        {
            streamPlayerControl1.Stop();
        }

        private void imageButton_Click(object sender EventArgs e)
        {
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            saveFileDialog1.Filter = “Bitmap Image|*.bmp“;
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                streamPlayerControl1.GetCurrentframe().Save(saveFileDialog1.FileName);
            }
        }

        private void UpdateButtons()
        {
            _playButton.Enabled = !streamPlayerControl1.IsPlaying;
            _stopButton.Enabled = streamPlayerControl1.IsPlaying;
            _imageButton.Enabled = streamPlayerControl1.IsPlaying;
        }

        private void HandleStreamStartedEvent(object sender EventArgs e)
        {
            UpdateButtons();

            _statusTextBox.Text = “Playing“;
        }

        private void HandleStreamFailedEvent(object sender StreamFailedEventArgs e)
        {
            UpdateButtons();

            _statusTextBox.Text = “Failed“;

            MessageBox.Show(e.Error “Stream Player Demo“
                MessageBoxButtons.OK MessageBoxIcon.Error);
        }

        private void HandleStreamStoppedEvent(object sender EventArgs e)
        {
            UpdateButtons();

            _statusTextBox.Text = “Stopped“;
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     40448  2019-03-11 12:03  WinFormsSource\.vs\StreamPlayerDemo\v15\.suo

     文件          0  2019-03-11 11:38  WinFormsSource\.vs\StreamPlayerDemo\v15\Server\sqlite3\db.lock

     文件       4096  2019-03-11 11:38  WinFormsSource\.vs\StreamPlayerDemo\v15\Server\sqlite3\storage.ide

     文件      32768  2019-03-11 12:02  WinFormsSource\.vs\StreamPlayerDemo\v15\Server\sqlite3\storage.ide-shm

     文件    1087712  2019-03-11 12:03  WinFormsSource\.vs\StreamPlayerDemo\v15\Server\sqlite3\storage.ide-wal

     文件        157  2015-07-23 06:03  WinFormsSource\StreamPlayerDemo\App.config

     文件      11776  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\bin\Debug\StreamPlayerDemo.exe

     文件        157  2015-07-23 06:03  WinFormsSource\StreamPlayerDemo\bin\Debug\StreamPlayerDemo.exe.config

     文件      22016  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\bin\Debug\StreamPlayerDemo.pdb

     文件   30013440  2019-03-11 11:52  WinFormsSource\StreamPlayerDemo\bin\Debug\WebEye.Controls.WinForms.StreamPlayerControl.dll

     文件       1995  2019-03-11 12:03  WinFormsSource\StreamPlayerDemo\Form1.cs

     文件       7496  2019-03-11 12:03  WinFormsSource\StreamPlayerDemo\Form1.Designer.cs

     文件       5817  2019-03-11 12:03  WinFormsSource\StreamPlayerDemo\Form1.resx

     文件       5702  2019-03-11 12:03  WinFormsSource\StreamPlayerDemo\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6438  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\obj\Debug\StreamPlayerDemo.csproj.CopyComplete

     文件         42  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\obj\Debug\StreamPlayerDemo.csproj.CoreCompileInputs.cache

     文件       1194  2019-03-11 11:46  WinFormsSource\StreamPlayerDemo\obj\Debug\StreamPlayerDemo.csproj.FileListAbsolute.txt

     文件        847  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\obj\Debug\StreamPlayerDemo.csproj.GenerateResource.cache

     文件      27633  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\obj\Debug\StreamPlayerDemo.csprojAssemblyReference.cache

     文件      11776  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\obj\Debug\StreamPlayerDemo.exe

     文件      22016  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\obj\Debug\StreamPlayerDemo.pdb

     文件        180  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\obj\Debug\StreamPlayerDemo.Properties.Resources.resources

     文件       3584  2019-03-11 11:38  WinFormsSource\StreamPlayerDemo\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件        180  2019-03-11 11:41  WinFormsSource\StreamPlayerDemo\obj\Debug\WindowsFormsApplication1.Form1.resources

     文件        171  2017-12-03 07:42  WinFormsSource\StreamPlayerDemo\packages.config

     文件       1030  2015-07-23 06:03  WinFormsSource\StreamPlayerDemo\Program.cs

     文件       1460  2015-07-23 06:03  WinFormsSource\StreamPlayerDemo\Properties\AssemblyInfo.cs

     文件       2860  2015-07-23 06:03  WinFormsSource\StreamPlayerDemo\Properties\Resources.Designer.cs

     文件       5612  2015-07-23 06:03  WinFormsSource\StreamPlayerDemo\Properties\Resources.resx

............此处省略21个文件信息

评论

共有 条评论