private void TryToCreateClient() { if (myHandle == IntPtr.Zero) { return; } string path = string.IsNullOrEmpty(myVlcLibPath) ? AppDomain.CurrentDomain.BaseDirectory : myVlcLibPath; if (!File.Exists(Path.Combine(path, "libvlc.dll")) || !File.Exists(Path.Combine(path, "libvlccore.dll"))) { return; } myClient = new VideoLanClient(path); myClient.PluginPath = Path.Combine(path, "plugins"); myPlayer = myClient.CreateMediaPlayer(myHandle); myPlayer.Audio.Volume = Volume; myPlayer.Audio.Mute = Mute; //todo //myPlayer.PositionChanged += // delegate(object sender, VlcPositionChangedEventArgs e) // { // Position = e.Position; // }; myPlayer.StateChanged += delegate(object sender, VlcStateChangedEventArgs e) { if (e.NewState == VlcState.Ended) { Position = 0; } }; }
/// <summary> /// Dispose of VlcManager /// </summary> public void Dispose() { if (myClient == null) { return; } myClient.Dispose(); myClient = null; }
internal VlcMediaList(VideoLanClient Vlc, IntPtr p_mlist) { this._Vlc = Vlc; //set our Media list pointer this.p_mlist = p_mlist; //Initalize our exception pointer p_exception = new libvlc_exception_t(); p_exception.Initalize(); }
/// <summary> /// Initializes a new instance of the <b>VlcMediaListPlayer</b> class. /// </summary> /// <param name="Vlc"></param> /// <param name="p_ml_player"></param> /// <param name="p_media_player"></param> internal VlcMediaListPlayer(VideoLanClient Vlc, VlcMediaList List, IntPtr p_ml_player, IntPtr p_media_player) : base(Vlc, p_media_player) { //set our Media instance pointer this.p_ml_player = p_ml_player; InteropMethods.libvlc_media_list_player_set_media_player(p_ml_player, p_media_player, ref p_ex); p_ex.CheckException(); Load(List); }
internal VlcMediaPlayer(VideoLanClient Vlc, IntPtr p_media_player) { _Vlc = Vlc; //set our Media instance pointer this.p_media_player = p_media_player; //Initalize our exception pointer p_ex = new libvlc_exception_t(); p_ex.Initalize(); _Audio = new VlcAudio(this); _Video = new VlcVideo(this); _Chapters = new VlcChapters(this); _Titles = new VlcTitles(this); _Subtitles = new VlcSubtitles(this); this.InitalizeEvents(); }