基本信息
源码名称:winfrom 做的播放器超级好用 已经测试完毕
源码大小:112.71M
文件格式:.rar
开发语言:C#
更新时间:2020-01-07
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 2 元 
   源码介绍


 




using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;

namespace WPFVLC
{
    /// <summary>
    /// VLCCtl.xaml 的交互逻辑
    /// </summary>
    public partial class VLCCtl : UserControl
    {
        public VLCCtl()
        {
            InitializeComponent();
        }
        
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            Load();
        }

        private void Load()
        {
            if (IntPtr.Size == 4)
            {
                // Use 32 bits library
                this.VLCPlayer.MediaPlayer.VlcLibDirectory = new DirectoryInfo(System.IO.Path.Combine(Environment.CurrentDirectory, "libvlc_x86"));
            }
            else
            {
                // Use 64 bits library
                this.VLCPlayer.MediaPlayer.VlcLibDirectory = new DirectoryInfo(System.IO.Path.Combine(Environment.CurrentDirectory, "libvlc_x64"));
            }

            var options = new string[]
            {
                // VLC options can be given here. Please refer to the VLC command line documentation.
            };

            this.VLCPlayer.MediaPlayer.VlcMediaplayerOptions = options;

            // Load libvlc libraries and initializes stuff. It is important that the options (if you want to pass any) and lib directory are given before calling this method.
            this.VLCPlayer.MediaPlayer.EndInit();
        }

        public void Stop()
        {
            this.VLCPlayer.MediaPlayer.Stop();
        }

        public void Play(string uri)
        {
            this.VLCPlayer.MediaPlayer.Play(uri);
        }

    }
}