Commit Graph

513 Commits

Author SHA1 Message Date
Arkadiusz Fal
d5f9a24efa Fix player controls clipping in resizable iPad windows
When playing video fullscreen in a resizable window on iPad, the player
height was being forced to UIScreen.main.bounds.size.height, which is
the full screen size. In resizable windows, this caused the player
container to extend beyond the visible window bounds, clipping controls
at the bottom.

Now on iPad, the player uses natural geometry provided by its container
which respects actual window bounds, while iPhone continues using
screen-based calculation for proper fullscreen behavior.
2025-11-14 23:26:20 +01:00
Arkadiusz Fal
2ca08c8af5 Hide orientation lock controls on iPad
The orientation lock feature is not applicable on iPad devices, so the lock orientation button and settings are now hidden when running on iPad.
2025-11-14 23:08:11 +01:00
Arkadiusz Fal
fcb97a5591 Remove verbose logging from MPV rendering
Removed debug log statements for screen refresh rate and successful render context calls to reduce log noise.
2025-11-14 20:51:05 +01:00
Arkadiusz Fal
763580203b Fix button styling and safe area handling on iOS
Added plain button style for rate increase/decrease buttons on iOS. Fixed safe area insets in VerticalCells to respect sidebar navigation style on iOS.
2025-11-14 20:49:48 +01:00
Arkadiusz Fal
a0a54bced9 Improve layout stability and disable unwanted animations
Added height reservation to FavoriteItemView to prevent layout shifts during content loading. Changed HomeView to use LazyVStack for better performance. Converted QueueView from LazyVStack to VStack. Disabled animations on content count changes across multiple views to prevent jarring layout transitions. Added width constraint to stream button in PlaybackSettings.
2025-11-14 20:02:07 +01:00
Arkadiusz Fal
6aef3f10b1 Improve playback settings UI controls on macOS
Standardized picker and button sizing with consistent alignment and control sizes. Added SettingsPickerModifier to all macOS pickers with menu style. Improved rate buttons with proper sizing and alignment. Added text truncation for stream descriptions to prevent overflow.
2025-11-14 19:28:26 +01:00
Arkadiusz Fal
8f97c40257 Refactor player controls and improve custom controls visibility
Restructured PlayerControls view hierarchy by extracting controls content into a separate computed property for better code organization. Added shouldShowCustomControls property to VideoPlayerView to properly determine when custom controls should be shown vs system controls. Updated hover logic to only show/hide custom controls when appropriate.
2025-11-14 18:58:28 +01:00
Arkadiusz Fal
ce7ba207ea Fix API availability issues for macOS 11.0 and tvOS 15.0
This commit resolves multiple build errors caused by using APIs that
require newer OS versions than the deployment targets (macOS 11.0 and
tvOS 15.0).

macOS fixes:
- Add missing init(frame:) initializer to PlayerLayerView
- Add availability checks for textSelection modifier (macOS 12.0+)
- Add availability checks for AttributedString (macOS 12.0+)
- Add availability checks for listStyle.inset(alternatesRowBackgrounds:) (macOS 12.0+)
- Add availability checks for focusScope modifier (macOS 12.0+)
- Correct listRowSeparator availability from macOS 12.0 to 13.0

tvOS fixes:
- Use older onChange(of:) signature compatible with tvOS 15.0
- Add availability check for Menu with primaryAction (tvOS 17.0+)

All changes include appropriate fallbacks for older OS versions to
maintain backward compatibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:53:06 +01:00
Arkadiusz Fal
be4e1adb9b Fix all SwiftLint violations across codebase
Resolves 130+ violations including deployment target checks, code style issues, and formatting inconsistencies. Adds SwiftLint disable comments for compiler-required availability checks while maintaining deployment target compliance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:14:35 +01:00
Arkadiusz Fal
cb2d9729ea Add top padding to playback speed controls
Improve spacing in PlaybackSettings view by adding top padding to the
playback speed section for better visual separation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:14:35 +01:00
Arkadiusz Fal
f4d4daccd0 Optimize SwiftUI performance throughout the app
This commit addresses multiple SwiftUI performance bottlenecks identified
through code analysis, focusing on view rendering efficiency, list
performance, and memory usage optimization.

Key improvements:

- HomeView: Optimize async task management using structured concurrency
  with async let to handle multiple Defaults updates in a single task

- VideoCell: Remove GeometryReader from VideoCellThumbnail to eliminate
  layout thrashing; change @ObservedObject to computed property for shared
  ThumbnailsModel

- ThumbnailView: Cache URL extension computation in init() instead of
  recalculating on every body evaluation

- FavoriteItemView: Replace filter().prefix() with early-exit loop and
  capacity reservation for significant performance gain on large lists

- ContentItemView: Optimize FetchRequest creation with direct predicate
  construction only for video items, empty predicate for others

- VideoPlayerView: Fix playerSize didSet trigger by moving
  updateSidebarQueue() calls to explicit onChange/onAppear handlers

- FeedView: Replace .unique() with Set-based deduplication for O(n)
  performance and reduced allocations

- VerticalCells: Remove expensive sorting on every redraw; items should
  be pre-sorted from source

These optimizations follow SwiftUI best practices by minimizing expensive
computations in view bodies, caching computed values, using efficient data
structures, and avoiding unnecessary redraws and layout passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:14:35 +01:00
ned
2461a33feb feat: default lang and mpv audio track switching 2025-06-01 22:19:03 +02:00
Arkadiusz Fal
9ca5d292ec Merge pull request #820 from yattee/video-details-gestures
add drag gestures to video details
2024-11-08 15:03:07 +01:00
Arkadiusz Fal
748bc16342 Merge pull request #818 from yattee/changes-to-opengl-view
improvements to MPVGLView
2024-11-08 15:02:15 +01:00
Arkadiusz Fal
798d2fc67f Merge pull request #817 from yattee/fix-subtitles
improved subtitle handling
2024-11-08 15:01:56 +01:00
Toni Förster
b4bcd0c0a0 add drag gestures to video details 2024-09-15 20:56:04 +02:00
Toni Förster
e62010d5d5 improvements to MPVGLView
- add Pixel Buffer Object to (PBO)
- add some debug logging
- add scissor testing
- add dirty region checking

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-14 15:04:17 +02:00
Toni Förster
3339e8cb1f improved subtitle handling
- fix subtitle disabling not working
- make subtitle adding/removing async
- make subtitle menu non blocking

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-14 11:33:12 +02:00
Toni Förster
72dcbe4515 allow user to disable fullscreen swipe gesture
furthermore, some rewording

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-12 16:57:48 +02:00
Arkadiusz Fal
102dfba751 Merge pull request #805 from yattee/mpv-better-performance
MPV: improved A/V sync
2024-09-11 09:29:14 +02:00
Toni Förster
5e85fd294c MPV: improved A/V sync
- use displays refresh rate
- execute needs drawing with higher priority
- run create() with higher priority
- determine the number of threads used for rendering
- enable VSYNC and change video-sync  to display-resample
- iOS/tvOS: set new display refresh rate on change
- run setSize with higher priority
- add more options to MPVClient
- get refresh rate updates
- sync refresh rate to fps
- update CADisplayLink to current refresh rate
- update refresh rate on macOS
- Add experimental feature to sync display  with content fps

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-08 15:59:42 +02:00
Toni Förster
b2421da95d apply new fullscreen logic to AppleAVPlayerView
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-06 17:13:08 +02:00
Toni Förster
4e4add3c42 fix double rotation
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-06 16:47:15 +02:00
Arkadiusz Fal
e3ac11c172 Merge pull request #786 from stonerl/simplified-fullscreen-and-orientation
iOS: Simplified fullscreen and orientation
2024-09-05 22:59:54 +02:00
Toni Förster
322a550666 simplified fullscreen and orientation handling
- iPad: rotate to device orientation on startup
- fixed controls in portrait fullscreen
- iOS: don’t call setNeedsDrawing multiple times
- On iOS we call set needs drawing only once.
- Added cooldown time to MPV.Client setNeedsDrawing to avoid multiple successive calls
- make fullscreen animation smoother
- dragGesture now calls toggleFullScreenAction
- fix tvOS and macOS build

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-05 18:17:14 +02:00
Toni Förster
5313e4ead0 player controls: add background opacity selection
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-05 15:14:39 +02:00
Arkadiusz Fal
59dd0785b3 Merge pull request #778 from stonerl/swipe-up-for-fullscreen
Gestures: swipe up toggles fullscreen
2024-09-04 09:16:23 +02:00
Toni Förster
119c663436 Gestures: swipe up toggles fullscreen 2024-09-03 21:20:56 +02:00
Toni Förster
d56ef74a99 fix picture in picture
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-03 21:17:20 +02:00
Toni Förster
1cb695848c make thumbnail fill the view in music mode
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-30 03:43:00 +02:00
Toni Förster
9510d91d61 Hide VideoActions Bar when no buttons is visible
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-28 12:32:59 +02:00
Toni Förster
c9c60349df Color changes to VideoActions
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-27 22:02:00 +02:00
Toni Förster
5dc197664d add new MPVKit repo
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-26 22:59:24 +02:00
Toni Förster
95d3170d31 fix regression and improve curentChapter handling
with #745 I left som testing changes in the PR that resulted in currentChapter index not being updated. This is fixed now.

Also, the ScrollViewReader waiter 0.5s before jumping to the current Chapter. So it is always drawn correctly.

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-26 00:46:35 +02:00
Arkadiusz Fal
3f871bce2c Fix possible crashes 2024-08-24 17:52:35 +02:00
Arkadiusz Fal
dc3492fd96 Fix tvOS comments 2024-08-24 14:30:51 +02:00
Arkadiusz Fal
dc7cee7388 Revert "Stay fullscreen when opening notification center"
This reverts commit 08c922f57c.
2024-08-24 13:56:25 +02:00
Arkadiusz Fal
1b1e95711a Fix typo 2024-08-24 12:59:38 +02:00
Arkadiusz Fal
ab493614ba Merge pull request #744 from stonerl/hide-comments
Allow hiding comments
2024-08-24 12:13:44 +02:00
Arkadiusz Fal
e7928d1016 Merge branch 'main' into chore-linter-warnings 2024-08-24 12:12:12 +02:00
Arkadiusz Fal
2b41c73d56 Merge pull request #743 from stonerl/controllcenter-swipe
Stay fullscreen when opening notification center
2024-08-24 12:09:28 +02:00
Arkadiusz Fal
516e305cd3 Merge pull request #742 from stonerl/subscription-button
Improvements to opening channels from Videos
2024-08-24 12:09:07 +02:00
Arkadiusz Fal
8921a38504 Merge pull request #741 from stonerl/timecodes-in-comments
iOS: make timestamps in comments touchable
2024-08-24 12:08:27 +02:00
Toni Förster
f5e509c091 Allow hiding comments 2024-08-20 20:39:21 +02:00
Toni Förster
08c922f57c Stay fullscreen when opening notification center
The upper 5% of the screen ignore swipe down gestures when in fullscreen, to avoid leaving fullscreen when opening the notification center.

fixes #702

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-20 16:14:57 +02:00
Toni Förster
0e8436ab40 VideoDetails: click on channel name opens channel
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-20 14:13:46 +02:00
Toni Förster
f3c876acf6 VideoDetails: open channel when touching the logo
The touch was consumed by the double touch action and the channel did not open.

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-20 14:00:43 +02:00
Toni Förster
9a450c9503 minor tweak to comment replies
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-20 01:23:54 +02:00
Toni Förster
7e346bf49c iOS: make timestamps in comments touchable
Timestamps in comments can now be touched and jump to the corresponding part in the video.

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-20 00:52:04 +02:00
Toni Förster
35534bcbb1 Improved thumbnail handling
- ThumbnailsModel optionally returns the quality
- Have constants for 4:3 and 16:9 aspect ratio
- Add high quality options for thumbnails
- Rename Highest quality to Best quality
- make 4:3 thumbnails fill the VideoCell
- use .maxes instead of .maxresdefault (the latter sometimes returns white images)

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-19 16:35:29 +02:00