Commit Graph

2436 Commits

Author SHA1 Message Date
Arkadiusz Fal
b38bd3f444 Update changelog for build 211 1.5.2-211 2025-11-23 17:17:48 +01:00
Arkadiusz Fal
d8e079ac90 Bump build number to 211 2025-11-23 17:11:12 +01:00
Arkadiusz Fal
75812906c1 Update dependencies 2025-11-23 17:08:39 +01:00
Arkadiusz Fal
82570b7f34 Fix SwiftFormat indentation in VideoContextMenuView
Applied SwiftFormat indentation rules to conditional overlay block in iOS-specific code.
2025-11-23 17:02:07 +01:00
Arkadiusz Fal
e43eddc8e7 Fix iOS menu text disappearing in ChannelVideosView
Applied ZStack overlay fix to the channel menu in ChannelVideosView
where the channel name, avatar, subscriber count, and view count
would disappear when tapping the menu.

Uses the same pattern:
- Visible static label with channel info stays on screen
- Invisible Menu overlay with .opacity(0) handles interactions
- Prevents text/avatar disappearing and resizing animations
2025-11-23 14:34:29 +01:00
Arkadiusz Fal
c5137a8af8 Prefer fast-loading formats when switching to AVPlayer
When switching from MPV to AVPlayer, prioritize HLS and stream formats over non-streamable MP4/AVC1 formats to avoid long loading times.

Changes:
- Added isFastLoadingFormat() helper to AVPlayerBackend
- Modified streamByQualityProfile to prefer fast-loading formats for AVPlayer
- Falls back to non-streamable formats only if no fast-loading option exists
- Ensures quick backend switching without waiting for metadata download
2025-11-23 14:20:28 +01:00
Arkadiusz Fal
9177abb0ec Fix iOS menu text disappearing in navigation headers
Extended the ZStack overlay fix to all iOS navigation header menus
where text labels would disappear when tapping the menu:

- HomeView: "Home" title menu
- PopularView: "Popular" title with icon menu
- TrendingView: Country/flag title menu
- PlaylistsView: Playlist title with thumbnail menu
- ChannelPlaylistView: Playlist title with thumbnail menu
- OpenVideosView: Playback mode picker menu

All menus now use the same pattern as PlaybackSettings:
- Visible static label layer in ZStack
- Invisible Menu overlay with .opacity(0)
- Prevents text disappearing and resizing animations
2025-11-23 14:16:21 +01:00
Arkadiusz Fal
65e86d30ec Fix iOS playback settings menu text disappearing and resizing issues
When tapping menus in playback settings (playback mode, quality profile,
stream, rate, captions, audio track), the selected value text would
disappear and cause unwanted resizing animations.

Implemented ZStack overlay technique for all iOS menu buttons:
- Visible static label remains on screen
- Invisible Menu overlay (.opacity(0)) handles tap interactions
- Prevents text from disappearing when menu opens
- Eliminates resizing animations on option selection
2025-11-23 14:09:14 +01:00
Arkadiusz Fal
0c4609bcf1 Update dependencies 2025-11-23 13:43:43 +01:00
Arkadiusz Fal
36190e62f5 Restrict orientation locking to iPhone only
- Add device checks in Orientation enum to prevent locking on iPad
- Hide "Lock portrait mode" setting on iPad in BrowsingSettings
- Use Constants.isIPhone for consistent device detection
2025-11-23 13:41:03 +01:00
Arkadiusz Fal
e6e69eb757 Add optional AVPlayer support for non-streamable MP4/AVC1 formats
AVPlayer has a fundamental limitation with MP4/AVC1 progressive downloads where the moov atom position affects playback start time. When moov is at the end of the file, AVPlayer must download the entire file before starting playback. MPV doesn't have this limitation.

This commit adds an advanced setting to optionally enable these formats in AVPlayer with appropriate warnings:

- Added new setting: "Enable non-streamable formats (MP4/AVC1)"
- Default: disabled (formats hidden, MPV handles them)
- When enabled: MP4/AVC1 formats up to 1080p appear in AVPlayer quality selector
- Resolution limit: 1080p maximum (higher resolutions can't be played properly)
- Clear warning about slow loading and 1080p limitation
- Automatic stream refresh when setting is toggled
- Full import/export support for the setting
2025-11-23 13:32:16 +01:00
Arkadiusz Fal
41a33634ee Fix YouTube share links including port from Invidious instance
Fixes #870 where YouTube share links incorrectly included the port number
from the user's Invidious instance URL (e.g., http://www.youtube.com:3000
instead of http://www.youtube.com).

Added defensive logic to explicitly clear the port when creating share URLs
with frontend URL strings containing "youtube.com". This ensures YouTube
share links always use the standard format without port numbers, regardless
of the user's instance configuration.
2025-11-23 12:00:02 +01:00
Arkadiusz Fal
aa703f6531 Fix Invidious search API parameters
Update search query parameters to match Invidious API:
- Change sort_by to sort
- Change upload_date to date
- Change view_count to views

Fixes #881
2025-11-23 11:51:25 +01:00
Arkadiusz Fal
db80b6adbb Restrict tvOS Cancel button to versions below 18
The Cancel button in VideoContextMenuView now only appears on tvOS 17 and earlier using #unavailable(tvOS 18.0) check.
2025-11-23 01:20:38 +01:00
Arkadiusz Fal
6591d503d4 Restrict context menu overlay to iOS only
The tap-blocking overlay is only needed on iOS to dismiss the context menu
on tap. Removed it from macOS and tvOS where it was either blocking normal
interactions or not functional due to platform limitations.
2025-11-23 01:18:55 +01:00
Arkadiusz Fal
1eba731283 Fix home view empty sections taking excessive vertical space
Removed fixed height constraint from empty state in FavoriteItemView.
Empty sections now collapse to natural height instead of reserving
full content height (290px iOS/600px tvOS), improving space efficiency.
2025-11-22 23:54:33 +01:00
Arkadiusz Fal
0913c6d73c Fix tvOS controls overlay button text legibility
Improved text contrast on overlay buttons by:
- Applying foreground color directly to button labels to ensure proper override
- Using semi-transparent gray background for unfocused buttons instead of Color.secondary
- Removing accent color overrides from caption text to respect button styling

This ensures readable text in both focused (black on white) and unfocused
(white on gray) states.
2025-11-22 23:40:23 +01:00
Arkadiusz Fal
997de6468d Improve tvOS controls overlay with single-press menus
Changed context menus from press-and-hold to single-press for better UX:
- Quality profile selection
- Stream quality selection
- Captions selection
- Audio track selection

Updated ControlsOverlayButton to support tap actions via new onSelect parameter.
Replaced .contextMenu modifiers with .alert for instant menu access on tvOS.
Removed hint text and unnecessary 80px padding as single-press is self-evident.
2025-11-22 23:39:55 +01:00
Arkadiusz Fal
1397a2fee6 Fix tvOS captions list always showing as unavailable in MPV
The captions context menu on tvOS was always empty because it relied on
an .onAppear callback that was never triggered. The captionsPicker view
with .onAppear was only rendered on iOS/macOS, not tvOS.

Changes:
- Access captions directly from player.currentVideo?.captions instead of
  using a state variable populated via .onAppear
- Fix label logic to show "Disabled" when captions are available but not
  selected, and "Not available" only when video has no captions
- Remove unused state variables and helper functions
2025-11-22 23:06:56 +01:00
Arkadiusz Fal
660891f2a5 Add hide videos without duration setting to macOS instance settings
Added the "Experimental: Hide videos without duration" toggle to the
macOS instance settings view to match the iOS/tvOS implementation.
2025-11-22 22:54:45 +01:00
Arkadiusz Fal
2e27dcd2cf Fix Invidious captions URL when companion is enabled
Prefix caption URLs with /companion when invidiousCompanion is enabled in instance settings. This ensures captions are routed through the companion service, matching the behavior of video streams.
2025-11-22 22:52:46 +01:00
Arkadiusz Fal
5f53e53c7a Fix iOS fullscreen gesture collision with notification center
In fullscreen playback, swipe-down and timeline seek gestures now respect a 60pt safe zone at the top of the screen, allowing the system notification center gesture to work without triggering app gestures.
2025-11-22 20:11:14 +01:00
Arkadiusz Fal
73295e726a Fix iOS comments scrolling issue in video details view
Comments at the bottom of the comments view were not accessible on iOS
without entering fullscreen mode. The issue was caused by the VideoDetails
view being offset by the player height when not in fullscreen, but the
ScrollView padding didn't account for this offset.

Changes:
- Add SafeAreaModel observer for iOS platform
- Update bottom padding to dynamically account for player height offset
  and safe area insets based on fullscreen state
- When not in fullscreen: padding = player height + safe area bottom + 20
- When in fullscreen: padding = max(60, safe area bottom + 20)

This ensures all comments and video details content are fully scrollable
and visible regardless of fullscreen state.
2025-11-22 19:54:36 +01:00
Arkadiusz Fal
b0dfd2f9d2 Add experimental setting to hide videos without duration in Invidious
This adds a new instance setting for Invidious that filters out videos
without duration information from feeds, popular, trending, search results,
and channel pages. This can be used to hide YouTube Shorts.

The setting is labeled as "Experimental: Hide videos without duration" and
includes an explanation that it can be used to hide shorts.

Key changes:
- Added hideVideosWithoutDuration property to Instance model
- Updated InstancesBridge to serialize/deserialize the new setting
- Added UI toggle in InstanceSettings with explanatory footer text
- Implemented filtering in InvidiousAPI for:
  * Popular videos
  * Trending videos
  * Search results
  * Subscription feed
  * Channel content
- Videos accessed directly by URL are not filtered
2025-11-22 19:42:18 +01:00
Arkadiusz Fal
735e7d62b6 Update changelog for build 210 1.5.2-210 2025-11-20 18:00:31 +01:00
Arkadiusz Fal
320c16fcc7 Bump build number to 210 2025-11-20 17:56:24 +01:00
Arkadiusz Fal
8c5c503df2 Fix iPad iOS 18 keyboard dismissal issue in search
Removed auto-focus logic that was causing keyboard show/hide loop
on iPad with docked keyboard. The keyboard was repeatedly dismissing
immediately after appearing due to interaction between keyboard
notifications, focus state changes, and view updates.

Changes:
- Removed focused state and keyboard observer from SearchModel
- Removed iOS textField reference (kept macOS only)
- Removed auto-focus logic from FocusableSearchTextField on iOS
- Cleaned up unused focus-related code

The search field now works reliably when tapped manually on iPad.
Auto-focus still works on macOS where it doesn't cause issues.
2025-11-20 17:49:10 +01:00
Arkadiusz Fal
36738572da Fix SwiftFormat and SwiftLint issues
- Fix indentation in AppSidebarNavigation, VideoCell
- Replace && with comma in PlayerModel condition
- Add SwiftLint suppression for necessary tvOS 17.0 availability check
- Update SwiftLint config to use renamed rules and disable false positives
2025-11-20 17:05:22 +01:00
Arkadiusz Fal
9a8ccc366c Clean up trending settings when feature flag is disabled
Add startup cleanup to remove trending-related settings when the feature flag is disabled:
- Remove trending from visible sections
- Reset startup section to home if it was set to trending
- Remove all trending favorite items

This ensures users don't have invalid/broken settings referencing the disabled trending feature.
2025-11-20 13:21:56 +01:00
Arkadiusz Fal
e9ca36f1db Fix Trending menu command to hide instead of disable
Change the Trending menu command to be completely hidden when the feature flag is disabled, rather than just being disabled and still visible in the UI.
2025-11-20 13:18:03 +01:00
Arkadiusz Fal
5b607687d9 Add feature flag to disable Trending functionality
Introduces a feature flag to disable the Trending section across the app. When disabled, all trending-related UI elements, navigation links, and settings are hidden.

Changes:
- Add trendingEnabled feature flag to FeatureFlags.swift (currently disabled)
- Hide Trending tab in AppTabNavigation, Sidebar, and TVNavigationView
- Remove Trending option from visible sections settings
- Remove Trending option from startup section picker
- Disable Trending menu command and keyboard shortcut
- Prevent Trending URL navigation in OpenURLHandler
- Hide Trending in FavoriteItemView navigation
2025-11-20 13:14:31 +01:00
Arkadiusz Fal
e723bb9147 Change Trending icon to arrow.up.right.circle.fill
Replace chart.bar.fill icon with arrow.up.right.circle.fill for the Trending section across tab bar and sidebar navigation.
2025-11-20 13:08:55 +01:00
Arkadiusz Fal
a3747a0975 Change Popular icon to chart.bar.fill
Replace arrow.up.right.circle.fill icon with chart.bar.fill for the Popular section across all navigation contexts (tab bar, sidebar, and view header).
2025-11-20 13:07:32 +01:00
Arkadiusz Fal
bb2bd86c07 Add feature flag to disable hide shorts functionality
The hide shorts feature is no longer working due to API changes that prevent reliable detection of short videos. This commit introduces a feature flag system to disable the functionality while preserving the ability to easily restore it if the API issue is resolved.

Changes:
- Add FeatureFlags.swift with hideShortsEnabled flag (currently disabled)
- Hide all HideShortsButtons UI elements when flag is disabled
- Disable shorts filtering logic in ContentItemView, FavoriteItemView, and FeedModel
- Preserve hideShorts user preference for future restoration
2025-11-20 13:05:12 +01:00
Arkadiusz Fal
680ac9a8a0 Fix keyboard shortcut conflict for Show Player command
Changed Show Player shortcut from Cmd+O to Cmd+Shift+P to avoid
conflict with system Open command.
2025-11-20 00:23:27 +01:00
Arkadiusz Fal
c1b23d20f2 Fix tab selection timing to wait for account sign-in
Tab selection was being set immediately during app configuration, before
the user account had completed sign-in. This caused tabs that require
authentication (like Subscriptions and Playlists) to not be properly
selected on startup since they weren't visible yet.

Changes:
- Add notification system for account configuration completion
- Post notification after all account types finish configuration:
  * Accounts with existing tokens
  * Accounts requiring sign-in (after network request completes)
  * Anonymous/public accounts
  * Error cases (missing credentials, network failures)
- Set up observer before account configuration to ensure notification
  is received
- Set tab selection only when account is fully configured
2025-11-19 23:24:21 +01:00
Arkadiusz Fal
b8f6dabbc9 Update SwiftUI-Introspect to support iOS 26
Upgrade SwiftUI-Introspect dependency from 1.3.0 to 26.0.0 and add iOS 26 support to the introspect modifier in AppSidebarNavigation.
2025-11-19 23:09:18 +01:00
Arkadiusz Fal
1c168bd982 Fix thumbnail aspect ratio to prevent stretching and layout jumps
Fixed issues with thumbnails being stretched vertically and layout jumping during image loading:
- Simplified VideoCellThumbnail to always use 16:9 aspect ratio with .fill mode
- Added matching 16:9 aspect ratio to placeholder with .fill mode to prevent layout shifts
- Removed quality-based aspect ratio selection (4:3 vs 16:9) in favor of consistent 16:9
- Ensures thumbnails maintain proper proportions on both iOS and macOS

This provides consistent sizing across platforms and eliminates the jump when images finish loading.
2025-11-19 23:01:52 +01:00
Arkadiusz Fal
42d53c30db Fix thumbnail aspect ratio in video grid cells
Thumbnails were being stretched vertically due to incorrect aspect ratio handling. Fixed by:
- Using .scaledToFill() on thumbnails to fill the container width
- Constraining container to 16:9 aspect ratio with .fit mode
- Adding matching aspect ratio to placeholder to prevent layout shift during loading

This ensures thumbnails maintain proper proportions while filling the full cell width.
2025-11-19 22:37:05 +01:00
Arkadiusz Fal
a55adb2e65 Fix thumbnail loading for video details
Explicitly specify thumbnail quality order instead of using Thumbnail.Quality.allCases to ensure proper thumbnail URL generation and loading priority.
2025-11-19 22:05:55 +01:00
Arkadiusz Fal
cea296c4b7 Fix audio session interrupting other apps on launch
Previously, the audio session was initialized immediately when the app launched, causing audio from other apps (like Music) to stop even when no video was playing in Yattee.

Changes:
- Remove audio session initialization from AppDelegate launch
- Remove audio session setup from MPVClient initialization
- Update setAudioSessionActive() to configure audio session category before activation

The audio session is now lazily initialized only when playback actually starts:
- For MPV backend: triggered by FILE_LOADED, PLAYBACK_RESTART, AUDIO_RECONFIG events
- For AVPlayer backend: triggered when play() is called

This allows music from other apps to continue playing until a video is actually played in Yattee.
2025-11-19 21:45:56 +01:00
Arkadiusz Fal
ea0ea427e7 Bump build number to 209 1.5.2-209 2025-11-19 18:55:21 +01:00
Arkadiusz Fal
f685e180d0 Update CHANGELOG.md for Build 209 2025-11-19 18:55:07 +01:00
Arkadiusz Fal
a37f3e4a07 Adjust tvOS video cell dimensions for better layout
Reduced video cell and grid item sizes on tvOS to improve layout spacing
and visual consistency. Changed grid item size from 600 to 560 pixels,
and adjusted video cell frame dimensions accordingly.
2025-11-19 18:54:51 +01:00
Arkadiusz Fal
33377f7e0e Fix nil crash when accessing stream.format
This commit addresses crashes caused by accessing nil format values on streams:

- QualityProfile.swift: Add guard check for stream.format to prevent nil access crash
- MPVBackend.swift: Add nil check in canPlay method before comparing format
- PlayerStreams.swift: Add nil check before comparing format in asset processing

The crashes occurred when stream.format was nil and accessed as an implicitly unwrapped optional, causing "Unexpectedly found nil while implicitly unwrapping an Optional value" errors.
2025-11-19 18:03:43 +01:00
Arkadiusz Fal
4b577a296b Fix array index out of bounds crash in audio track handling
This commit addresses crashes caused by race conditions when accessing audio track arrays:

- MPVBackend.swift: Use safe index clamping to prevent array out of bounds crashes when selecting audio tracks
- PlayerModel.swift: Add selectedAudioTrack computed property for thread-safe audio track access
- ControlsOverlay.swift: Use safe accessor with "Original" fallback label
- PlaybackSettings.swift: Use safe accessor with "Original" fallback label

This fix resolves approximately 37% of crashes (23 out of 62 crash logs) that were caused by index out of range errors in MPVBackend.playStream at line 345.
2025-11-19 18:01:02 +01:00
Arkadiusz Fal
e882d0264b Fix thumbnail sizing and aspect ratio issues in video cells (#896)
Fixed improperly sized and positioned thumbnails by removing duplicate aspect ratio constraints and standardizing to 4:3 format with fill content mode for better display.
2025-11-19 17:50:39 +01:00
Arkadiusz Fal
45f72ce4a1 Fix playing videos from channel view in modal opened in video player
Handle case where player is already presenting by using delayed dispatch instead of appending to onPresentPlayer callback queue.
2025-11-19 01:32:09 +01:00
Arkadiusz Fal
3536370798 Refactor fullscreen details layout from VStack to ZStack
Switch from VStack to ZStack layout for better control over detail view positioning in fullscreen mode. Add z-index layering to ensure proper stacking order of player backend and video details.
2025-11-19 00:57:00 +01:00
Arkadiusz Fal
a5275fd800 Remove verbose logging statements
Removed logging for audio session activation and partial update operations to reduce log noise.
2025-11-18 18:19:45 +01:00