Inheritance: VideoLAN.LibVLC.EventingObject
示例#1
0
文件: testvlc.cs 项目: rdp/vlc-1
        public static int Main(string[] args)
        {
            string[] argv = new string[]{
                "-vv", "-I", "dummy", "--plugin-path=../../modules"
            };

            Console.WriteLine ("Running on LibVLC {0} ({1})", VLC.Version,
                               VLC.ChangeSet);
            Console.WriteLine (" (compiled with {0})", VLC.Compiler);

            VLC vlc = new VLC (argv);
            foreach (string mrl in args)
            {
                Media media = new Media (vlc, mrl);
                Player player = new Player (media);

                DumpMedia (media);
                DumpMedia ((Media)media.Clone ());
                media.StateChanged += WriteMediaState;

                /*foreach (MetaType type in Enum.GetValues (typeof (MetaType)))
                {
                    string meta = media.GetMeta (type);
                    if (meta != null)
                        Console.WriteLine (" {0}: {1}", type, meta);
                }*/

                player.Play ();
                do
                {
                    DumpPlayer (player);
                    Sleep (500);
                }
                while (player.IsPlaying);
                player.Stop ();
                media.Dispose ();
                player.Dispose ();
            }

            vlc.Dispose ();
            return 0;
        }
示例#2
0
文件: testvlc.cs 项目: rdp/vlc-1
        private static void DumpPlayer(Player p)
        {
            if (!p.IsPlaying)
                return;

            int percent = (int)(p.Position * 100);
            Console.Write ("{0}: {1} of {2} ms ({3}%)\r", p.State,
                           p.Time, p.Length, percent);
        }