Skip to content

Commit

Permalink
Adding debugging test and removed task.run which killed timer
Browse files Browse the repository at this point in the history
  • Loading branch information
cDima committed Dec 7, 2016
1 parent ab97187 commit 33d710c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions ScreenSaver/ScreenSaverForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public partial class ScreenSaverForm : Form
private bool shouldCache = false;
int currentVideoIndex = 0;
List<Asset> Movies;
Timer NextVideoTimer = new Timer();
DateTime lastInteraction = DateTime.Now;

public ScreenSaverForm()
Expand All @@ -36,7 +37,7 @@ public ScreenSaverForm(bool WindowMode = false) : this()
SetStyle(ControlStyles.Opaque, true);
this.BackColor = Color.Transparent;

windowMode = true;
windowMode = WindowMode;
MaximizeVideo();

this.MouseDown += ScreenSaverForm_MouseDown;
Expand Down Expand Up @@ -75,24 +76,28 @@ private void ScreenSaverForm_Load(object sender, EventArgs e)

this.BackgroundImageLayout = ImageLayout.None;

Task.Run(() =>
if (ShowVideo && !previewMode)
{
if (ShowVideo && !previewMode)
{
Movies = new AerialContext().GetMovies();

var nextVideoTimer = new System.Windows.Forms.Timer();
nextVideoTimer.Tick += NextVideoTimer_Tick;
nextVideoTimer.Interval = 1000;
nextVideoTimer.Enabled = true;
Movies = new AerialContext().GetMovies();

SetNextVideo();
} else
#if DEBUG
Movies = new List<Asset>
{
// on preview - hide player.
this.player.Visible = false;
}
});
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;

SetNextVideo();
} else
{
// on preview - hide player.
this.player.Visible = false;
}
}

private void MaximizeVideo()
Expand Down
Binary file modified install/AerialScreenSaverV3.exe
Binary file not shown.
Binary file modified install/AerialScreenSaverV3.scr
Binary file not shown.

0 comments on commit 33d710c

Please sign in to comment.