]> git.sesse.net Git - nageru-docs/commitdiff
Write about controlling video playback.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 28 May 2017 11:08:05 +0000 (13:08 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 28 May 2017 11:08:05 +0000 (13:08 +0200)
video.rst

index 4e7c41ec1c45ee949154e4890819130916c66de8..d42fce3dfc13404d5e4a237712a4cffd3a616b01 100644 (file)
--- a/video.rst
+++ b/video.rst
@@ -74,7 +74,26 @@ stream is broken and hasn't reconnected yet).
 Controlling video playback
 --------------------------
 
-TODO
+Themes have some programmatic control over video playback. In particular,
+if you want to make a video start from the beginning, you can do::
+
+  video:rewind()
+
+which will instantly make it start from the first frame again. This can be
+useful if you e.g. want the video to start when you're switching to it,
+or if you're not really using it to loop (e.g. as a transition marker).
+
+You can also change its rate, e.g. by::
+
+  video:change_rate(2.0)
+
+This will make it play at twice its usual speed. Your rate should not be
+negative nor exactly zero. Be aware that once you've set a rate, the player
+will wait for the next frame before considering any other commands,
+so if you set your rate to e.g. 0.001 to nearly stop it, you will indeed
+need to wait 16.67 seconds (assuming 60 fps video) before you can speed it
+up again. This restriction may be lifted in the future.
+
 
 Integration with CasparCG
 -------------------------