public MainWindow()
        {
            InitializeComponent();
            _vlcPlugin = new AxVLCPlugin2();
            VlcHost.Child = _vlcPlugin;
            _vlcPlugin.MediaPlayerPositionChanged += _vlcPlugin_MediaPlayerPositionChanged;
            _vlcPlugin.MediaPlayerTimeChanged += _vlcPlugin_MediaPlayerTimeChanged;
            Position.AddHandler(MouseLeftButtonUpEvent, new MouseButtonEventHandler(Position_MouseLeftButtonUp), true);

            Loaded += MainWindow_Loaded;
        }
        public VideoWindow(GestureDirection direction, GestureType type)
        {
            InitializeComponent();
            this.Title = type + " " + direction;

            vlc = new AxVLCPlugin2();
            formHost.Child = vlc;
            vlc.CreateControl();

            var videoPath = CreateUriTo(type, direction);
            MoveScreen(true);
            GestureParser.Pause(true);
            vlc.playlist.add(videoPath);
            vlc.playlist.play();

            EventHandler handler = null;

            handler = (sender, e) => {
                vlc.MediaPlayerEndReached -= handler;
                GestureParser.Pause(false);
                MoveScreen(false);
                canvasWindow.Activate();
                vlc.playlist.play();
                vlc.MediaPlayerEndReached += (senderI, eI) => {
                    vlc.playlist.play();
                };

            };

            vlc.MediaPlayerEndReached += handler;
        }
Exemple #3
0
 private void MediaPlayerEndReached(object sender, EventArgs e)
 {
     AxAXVLC.AxVLCPlugin2 vlcPlayer = (AxAXVLC.AxVLCPlugin2)sender;
     vlcPlayer.MediaPlayerEndReached -= MediaPlayerEndReached;
     vlcPlayer.Visible = false;
     vlcPlayer.Dispose();
 }
Exemple #4
0
        private static AxVLCPlugin2 CreateVLCControl()
        {
            var vlc = new AxAXVLC.AxVLCPlugin2();

            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            ((System.ComponentModel.ISupportInitialize)(vlc)).BeginInit();
            vlc.Enabled  = true;
            vlc.Name     = "vlc";
            vlc.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axVLCPlugin21.OcxState")));
            ((System.ComponentModel.ISupportInitialize)(vlc)).EndInit();

            return(vlc);
        }
        public VideoComponent(LiveSplitState state, AxVLCPlugin2 vlc)
            : base(state, vlc, ex => ErrorCallback(state.Form, ex))
        {
            Settings = new VideoSettings();
            Settings.txtVideoPath.TextChanged += txtMRL_TextChanged;
            State = state;
            VLC = vlc;
            //Control.Visible = false;

            state.OnReset += state_OnReset;
            state.OnStart += state_OnStart;
            state.OnPause += state_OnPause;
            state.OnResume += state_OnResume;
        }
Exemple #6
0
 private void mainPic_Click(object sender, EventArgs e)      //확대한 사진 클릭했을때 지우기
 {
     if (sender is PictureBox)
     {
         PictureBox mainPic = (PictureBox)sender;
         mainPic.Click -= mainPic_Click;
         mainPic.Dispose();
     }
     else if (sender is AxAXVLC.AxVLCPlugin2)
     {
         AxAXVLC.AxVLCPlugin2 vlcPlayer = (AxAXVLC.AxVLCPlugin2)sender;
         vlcPlayer.Click  -= mainPic_Click;
         vlcPlayer.Visible = false;
     }
 }
Exemple #7
0
        private void Pic1_Click(object sender, EventArgs e)     //사진 클릭했을때 확대
        {
            PictureBox Pic1 = (PictureBox)sender;

            if (!Pic1.Name.Contains("Video"))
            {
                PictureBox mainPic = new PictureBox();
                mainPic.Location = new Point(0, 0);
                mainPic.Size     = this.Size;
                mainPic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
                mainPic.Image    = Pic1.Image;
                this.Controls.Add(mainPic);
                mainPic.BringToFront();
                mainPic.Click += mainPic_Click;
            }
            else
            {
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VideoPlayer));
                AxAXVLC.AxVLCPlugin2 vlcPlayer = new AxAXVLC.AxVLCPlugin2();
                this.SuspendLayout();
                vlcPlayer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("vlcPlayer.OcxState")));
                vlcPlayer.Enabled  = true;
                vlcPlayer.Name     = "vlcPlayer";
                vlcPlayer.TabIndex = 0;


                vlcPlayer.Visible  = true;
                vlcPlayer.Location = new Point(0, 0);
                vlcPlayer.Size     = this.Size;

                this.Controls.Add(vlcPlayer);
                this.ResumeLayout();


                Uri uri = new Uri(Pic1.Name.Replace("jpg", "mp4"));

                vlcPlayer.playlist.add(uri.AbsoluteUri);



                vlcPlayer.BringToFront();
                vlcPlayer.MediaPlayerEndReached += MediaPlayerEndReached;
                vlcPlayer.playlist.play();
            }
        }
Exemple #8
0
        public MainWindow()
        {
            vlc = new AxVLCPlugin2();
            InitializeComponent();
            WinFormsHost.Child = vlc; 
            login_thread = new BackgroundWorker();
            login_thread.RunWorkerCompleted += login_thread_RunWorkerCompleted;
            login_thread.DoWork += login_thread_DoWork;

            loadchannel_thread = new BackgroundWorker();
            loadchannel_thread.RunWorkerCompleted += loadchannel_RunWorkerCompleted;
            loadchannel_thread.DoWork += loadchannel_DoWork;

            loadfav_thread = new BackgroundWorker();
            loadfav_thread.RunWorkerCompleted += loadfav_RunWorkerCompleted;
            loadfav_thread.DoWork += loadfav_DoWork;

            updatelist_thread = new BackgroundWorker();
            updatelist_thread.RunWorkerCompleted += updatelist_thread_RunWorkerCompleted;
            updatelist_thread.DoWork += updatelist_thread_DoWork;

            login_thread.RunWorkerAsync();
        }
        private void CreatePlayer()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MoviePlayer));
            for (int i = 0; i < playerCount; i++)
            {
                player[i] = new AxVLCPlugin2();
                ((System.ComponentModel.ISupportInitialize)(player[i])).BeginInit();
                player[i].Enabled = true;
                this.axVLCPlugin21.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axVLCPlugin21.OcxState")));
                player[i].Margin = new System.Windows.Forms.Padding(0);
                player[i].Location = new Point(0, 0);

                player[i].Size = new Size(width, height);
                player[i].PreviewKeyDown += new PreviewKeyDownEventHandler(axVLCPlugin21_PreviewKeyDown);
                player[i].MediaPlayerEndReached += MoviePlayer_MediaPlayerEndReached;
                flowLayoutPanel1.Controls.Add(player[i]);
                ((System.ComponentModel.ISupportInitialize)(player[i])).EndInit();
                player[i].AutoLoop = true;
                player[i].AutoPlay = true;
                player[i].volume = 80;
                if (movies.Count != 0)
                {
                    Movie m = movies.Dequeue();
                    player[i].playlist.add(@"file:///" + m.location);
                    player[i].playlist.play();
                }
                if (movies.Count != 0 && playerCount-i <= movies.Count)
                {
                    Movie m2 = movies.Dequeue();
                    player[i].playlist.add(@"file:///" + m2.location);
                }
            }
        }
        private static AxVLCPlugin2 CreateVLCControl()
        {
            var vlc = new AxAXVLC.AxVLCPlugin2();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            ((System.ComponentModel.ISupportInitialize)(vlc)).BeginInit();
            vlc.Enabled = true;
            vlc.Name = "vlc";
            vlc.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axVLCPlugin21.OcxState")));
            ((System.ComponentModel.ISupportInitialize)(vlc)).EndInit();

            return vlc;
        }