public Player(VLCMedia Media) { IsDisposed = false; Parent = Media; Console.WriteLine("========== MEDIA :: {0}", Media.Source); Handle = VLCAPI.Media.Player.FromMedia(Media); Event = new VLCEventBinding(VLCEventType.MediaPlayerEncounteredError); Event.SetInvoked((o, u) => { Console.WriteLine("ERROR: {0}", VLCAPI.GetErrorMsg()); }); VLCAPI.Event.Attach(this, Event); }
public VLCMedia(VLCInterface VLCInstance, String PlayString, Boolean IsFilePath = false) { IsDisposed = false; Source = PlayString; Parent = VLCInstance; Handle = IsFilePath ? VLCAPI.Media.FromPath(VLCInstance, PlayString) : VLCAPI.Media.FromMRL(VLCInstance, PlayString); Event = new VLCEventBinding(VLCEventType.MediaStateChanged); Event.SetInvoked((o, u) => { Console.WriteLine((VLCMediaState)o.media_state_changed.new_state); }); VLCAPI.Event.Attach(this, Event); Player = new Player(this); }
public static Boolean Attach(IVLCSubscribable Object, VLCEventBinding Event) { return(Attach(Object, Event.Type, Event.EventDelegate, Event.UserData)); }
public static void Detach(IVLCSubscribable Object, VLCEventBinding Event) { Detach(Object, Event.Type, Event.EventDelegate, Event.UserData); Event.NotifyDetached(); }