Example #1
0
        public bool OpenMediaFromPath(string path)
        {
            media = lib.CreateMediaFromPath(path);
            if (media == null)
            {
                return(false);
            }

            return(OpenMediaFromMedia(media));
        }
Example #2
0
        public bool OpenMediaFromUri(Uri uri)
        {
            media = lib.CreateMediaFromUri(uri);
            if (media == null)
            {
                return(false);
            }

            return(OpenMediaFromMedia(media));
        }
Example #3
0
        public bool OpenMediaFromMedia(VLCMedia media)
        {
            if (media == null)
            {
                return(false);
            }

            player        = new VLCMediaPlayer(lib, media);
            player.width  = width;
            player.height = height;

            if (player == null)
            {
                return(false);
            }

            player.NewFrameEvent += delegate(object sender, INewFrameEventArgs e) {
                //Gtk.Application.Invoke (delegate {
                //Gdk.Pixbuf old =  output.Pixbuf;
                Gdk.Pixbuf old = output.Pixbuf;

                output.Pixbuf = (Gdk.Pixbuf)e.frame.Clone();

                if (old != null)
                {
                    old.Dispose();
                    old = null;
                }

                //if(old!=null)
                //{
                //old.Dispose();
                //old = null;
                //}

                //});

                if (NewFrameEvent != null)
                {
                    NewFrameEvent(sender, e);
                }

                System.GC.Collect();
            };

            //player.SetDrawable (output);

            return(true);
        }
Example #4
0
        public VLCMediaPlayer(LibVLC core, VLCMedia media)
        {
            _this = GCHandle.Alloc(this);

            _core  = core;
            _media = media;


            _instance = VLCNative.MediaPlayer.libvlc_media_player_new_from_media(_media.Handler);

            VLCNative.MediaPlayer.libvlc_video_set_callbacks(_instance, LockCalback, UnlockCalback, DisplayCalback, (IntPtr)_this);

            drawObject = new Gtk.Image();

            _eventManager = new VLCEventManager(this);
        }
Example #5
0
 public VLCMediaPlayer CreatePlayer(VLCMedia media)
 {
     return(new VLCMediaPlayer(this, media));
 }