Implemented new "Autoplay" parameter to start the player in the
playback mode. Positioning during playback is now allowed. The desktop
contents is now being updated correctly on startup and after
positioning in the paused mode. Also a number of minor cleanups.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2520 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/java/src/com/tightvnc/rfbplayer/RfbPlayer.java b/java/src/com/tightvnc/rfbplayer/RfbPlayer.java
index 1da501c..c2fa6f6 100644
--- a/java/src/com/tightvnc/rfbplayer/RfbPlayer.java
+++ b/java/src/com/tightvnc/rfbplayer/RfbPlayer.java
@@ -60,6 +60,7 @@
URL url;
long initialTimeOffset;
double playbackSpeed;
+ boolean autoPlay;
boolean showControls;
int deferScreenUpdates;
@@ -158,12 +159,13 @@
while (true) {
try {
- setPaused(true);
- setPos(initialTimeOffset);
+ setPaused(!autoPlay);
rfb.fbs.setSpeed(playbackSpeed);
+ setPos(initialTimeOffset);
vc.processNormalProtocol();
} catch (EOFException e) {
initialTimeOffset = 0;
+ autoPlay = false;
rfb.newSession(url);
}
}
@@ -216,15 +218,22 @@
public void readParameters() {
sessionURL = readParameter("URL", true);
+
initialTimeOffset = readLongParameter("Position", 0);
if (initialTimeOffset < 0)
initialTimeOffset = 0;
+
playbackSpeed = readDoubleParameter("Speed", 1.0);
if (playbackSpeed <= 0.0)
playbackSpeed = 1.0;
+ autoPlay = false;
+ String str = readParameter("Autoplay", false);
+ if (str != null && str.equalsIgnoreCase("Yes"))
+ autoPlay = true;
+
showControls = true;
- String str = readParameter("Show Controls", false);
+ str = readParameter("Show Controls", false);
if (str != null && str.equalsIgnoreCase("No"))
showControls = false;