Skip to content

Fix Video Player Controls Behavior #1

@Ph-ill

Description

@Ph-ill

Current Behavior

Video Controls Display

  • Video controls appear automatically when a video starts playing
  • Controls remain visible for the entire duration of video playback
  • Controls do not auto-hide after a timeout period

Navigation vs Seeking Behavior

  • Left/Right buttons: Always navigate between videos in the thread, regardless of control visibility
  • Seeking functionality: Currently non-functional - pressing left/right while controls are visible does not seek within the current video
  • Control visibility state: Not properly tracked or utilized for different button behaviors

Desired Behavior

Video Controls Display

  • Initial load: Controls should NOT appear automatically when a video starts playing
  • Manual show: Controls should only appear when the user presses the Down button
  • Auto-hide: Controls should automatically hide after 1-2 seconds of inactivity
  • Manual hide: Pressing Down again should hide controls immediately

Navigation vs Seeking Behavior

  • When controls are HIDDEN:

    • Left button: Navigate to previous video in thread
    • Right button: Navigate to next video in thread
    • Enter button: Toggle play/pause
    • Down button: Show controls
  • When controls are VISIBLE:

    • Left button: Seek 10 seconds backward in current video
    • Right button: Seek 10 seconds forward in current video
    • Down button: Hide controls immediately
    • Enter button: Toggle play/pause

Additional Requirements

  • Focus management: Video player should maintain proper focus to prevent key events from leaking to the thread list behind it
  • Back button: Should always return to thread list regardless of control state
  • Clean transitions: No visual artifacts when switching between navigation and seeking modes

Technical Implementation Notes

Files to Modify

  • app/src/main/java/com/example/chan/MediaFragment.kt

Key Changes Needed

  1. Control visibility tracking: Implement proper boolean flag to track if controls are visible
  2. Conditional key handling: Different behavior for left/right based on control visibility
  3. Seeking implementation: Use ExoPlayer's seek functionality when controls are visible
  4. Auto-hide timer: Implement coroutine-based timer for auto-hiding controls
  5. Focus management: Ensure video player maintains focus and consumes key events properly

Current Code Issues

  • areControlsVisible flag exists but is not properly utilized
  • Seeking logic is implemented but not working correctly
  • Control show/hide logic needs refinement
  • Key event handling needs to be more robust

Priority

  • Medium priority - not blocking for 0.1.0 release
  • Should be addressed before 0.2.0 release
  • Affects user experience but doesn't break core functionality

Testing Checklist

  • Controls don't show automatically on video start
  • Down button toggles controls on/off
  • Left/right navigate between videos when controls hidden
  • Left/right seek within video when controls visible
  • Controls auto-hide after timeout
  • Back button always returns to thread list
  • No key event leakage to background UI

Related Issues

  • This issue is tracked in TODO.md for future reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions