Fix overlay template cycling during match video playback

- Set video_phase='match' in rtsp_streamer._switch_to_video() when playing UNDER/OVER videos
- Stop template rotation immediately when match/result phase detected in overlay-controller.js
- This prevents the overlay from cycling between fixtures/match templates during match video
- Results template now properly displays after match video ends
parent 07182e9c
...@@ -1261,8 +1261,7 @@ class RTSPStreamer(ThreadedComponent): ...@@ -1261,8 +1261,7 @@ class RTSPStreamer(ThreadedComponent):
"fixture_id": fixture_id "fixture_id": fixture_id
}) })
self._switch_to_video(str(match_video_path), loop=False) self._switch_to_video(str(match_video_path), loop=False, video_type='match')
self.current_video_type = 'match'
else: else:
logger.error(f"Match video not found: {video_filename}") logger.error(f"Match video not found: {video_filename}")
...@@ -1296,8 +1295,7 @@ class RTSPStreamer(ThreadedComponent): ...@@ -1296,8 +1295,7 @@ class RTSPStreamer(ThreadedComponent):
'is_result_video': True 'is_result_video': True
}) })
self._switch_to_video(str(result_video_path), loop=False) self._switch_to_video(str(result_video_path), loop=False, video_type='result')
self.current_video_type = 'result'
else: else:
logger.error(f"Result video not found for {result}") logger.error(f"Result video not found for {result}")
...@@ -1514,8 +1512,7 @@ class RTSPStreamer(ThreadedComponent): ...@@ -1514,8 +1512,7 @@ class RTSPStreamer(ThreadedComponent):
"fixture_id": self.current_fixture_id "fixture_id": self.current_fixture_id
}) })
self._switch_to_video(str(match_video_path), loop=False) self._switch_to_video(str(match_video_path), loop=False, video_type='match')
self.current_video_type = 'match'
self.current_match_video_filename = video_filename self.current_match_video_filename = video_filename
else: else:
logger.error(f"OVER/UNDER video not found: {video_filename}") logger.error(f"OVER/UNDER video not found: {video_filename}")
...@@ -1550,8 +1547,7 @@ class RTSPStreamer(ThreadedComponent): ...@@ -1550,8 +1547,7 @@ class RTSPStreamer(ThreadedComponent):
'is_result_video': True 'is_result_video': True
}) })
self._switch_to_video(str(result_video_path), loop=False) self._switch_to_video(str(result_video_path), loop=False, video_type='result')
self.current_video_type = 'result'
else: else:
logger.error(f"Result video not found for {self.current_result}") logger.error(f"Result video not found for {self.current_result}")
......
...@@ -653,6 +653,13 @@ class WebOverlayController { ...@@ -653,6 +653,13 @@ class WebOverlayController {
this.phaseTransitionTimer = null; this.phaseTransitionTimer = null;
} }
// IMPORTANT: Stop template rotation IMMEDIATELY for match/result phases
// Don't wait for the delay - the rotation interferes with the phase-based templates
if (newPhase === 'match' || newPhase === 'result') {
this.log(`Phase ${newPhase} detected - stopping template rotation immediately`);
this.stopTemplateRotation();
}
// Schedule the template change with delay compensation // Schedule the template change with delay compensation
this.phaseTransitionTimer = setTimeout(() => { this.phaseTransitionTimer = setTimeout(() => {
this.executePhaseTransition(newPhase, data); this.executePhaseTransition(newPhase, data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment