Exemple #1
0
        private void ScreenSaverForm_Load(object sender, EventArgs e)
        {
            if (!previewMode && !windowMode)
            {
                Cursor.Hide();
            }

            if (this.providedBounds != null)
            {
                Bounds = providedBounds;
            }
            //MessageBox.Show($"Bounds (ScreenSaverForm_Load): {Bounds.Left}+{Bounds.Top}, {Bounds.Size.Width}x{Bounds.Size.Height}");
            LayoutPlayer();

            this.BackgroundImageLayout = ImageLayout.None;

            if (showVideo) // testing preview video speed didn't work well && !previewMode
            {
                Movies = AerialContext.GetMovies();

#if DEBUG && false
                Movies = new List <Asset>
                {
                    new Asset {
                        url = @"http://18292-presscdn-0-89.pagely.netdna-cdn.com/wp-content/uploads/2015/07/stripe-checkout.mp4?_=1"
                    },
                    new Asset {
                        url = @"http://18292-presscdn-0-89.pagely.netdna-cdn.com/wp-content/uploads/2015/07/stripe-shake.mp4?_=3"
                    },
                };
#endif

                //NextVideoTimer.Tick += NextVideoTimer_Tick;
                //NextVideoTimer.Interval = 1000;
                //NextVideoTimer.Enabled = true;

                currentVideoIndex = selector.next(Movies.Count);
                SetNextVideo();
            }
            else if (previewMode)
            {
                // on preview - hide player.
                ShowButtons(false);

                // show picture preview in the windows screensaver dialog inside the 1980s CRT monitor with that CD rom drive at it's bottom

                var pictureBox1 = new PictureBox();
                pictureBox1.Image    = global::Aerial.Properties.Resources.bridgeSm3;
                pictureBox1.Location = new System.Drawing.Point(0, 0);
                pictureBox1.Name     = "pictureBox1";
                pictureBox1.Size     = new System.Drawing.Size(166, 130);
                pictureBox1.TabIndex = 3;
                pictureBox1.TabStop  = false;
                this.Controls.Add(pictureBox1);
            }
        }