From 870d0c84047de7079453048f6ec40ee609e0581b Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 20 Jul 2024 10:33:08 -0700 Subject: [PATCH] Replay video from start when play is pressed at end Closes #510 --- Tusker/Screens/Gallery/VideoOverlayViewController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tusker/Screens/Gallery/VideoOverlayViewController.swift b/Tusker/Screens/Gallery/VideoOverlayViewController.swift index 63eb056a..cbc7d02c 100644 --- a/Tusker/Screens/Gallery/VideoOverlayViewController.swift +++ b/Tusker/Screens/Gallery/VideoOverlayViewController.swift @@ -106,6 +106,9 @@ class VideoOverlayViewController: UIViewController { if player.rate > 0 { player.rate = 0 } else { + if player.currentTime() >= player.currentItem!.duration { + player.seek(to: .zero) + } #if os(visionOS) player.play() #else