Commit Graph

195 Commits

Author SHA1 Message Date
Toni Förster
a65ed67751
proper audio interrupt and route change handling
- set AVAudioSession inactive on pause and stop
- handle audio route changes
2024-09-13 11:21:07 +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
0de0445805
check if subtitles are added before removing them
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-09 14:18:49 +02:00
Toni Förster
9cb0325503
more robust resolution handling
Currently, we have a hard-coded list of resolutions. Since Invidious reports the actual resolution of a stream and does not hard-code them to a fixed value anymore, resolutions that are not in the list won’t be handled, and the stream cannot be played back.

Instead of hard-coding even more resolutions (and inadvertently might not cover all), we revert the list back to a finite set of resolutions, the users can select from. All other resolutions are handled dynamically and compared to the existing set of defined resolutions when selecting the best stream for playback.

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-09 12:59:39 +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
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
e8fcee23ef
make audio ducking and interruption more robust
Signed-off-by: Toni Förster <toni.foerster@gmail.com>

fix audio ducking and bluetooth play/pause

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-03 21:19:30 +02:00
Arkadiusz Fal
e9f502a486
Merge pull request #775 from stonerl/fix-crash-on-hls-live-playback 2024-08-31 14:54:08 +02:00
Toni Förster
6978e9437c
fix crash on HLS live playback
fixes #774

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-31 14:22:28 +02:00
Arkadiusz Fal
2026201a5f
Merge pull request #765 from stonerl/partial-fix-for-503
Update now playing info when using system controls – Partial fix for 503
2024-08-31 13:21:41 +02:00
Toni Förster
633af02577
don’t activate AVAudioSession on app start
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-31 13:19:54 +02:00
Toni Förster
617af2cd20
format ordering adapted
- MP4 contains av1 encoded video which is not hardware accelerated.
- MP4 format removed from AVPlayer

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-30 22:04:31 +02:00
Toni Förster
1a22ac71be
move AVAudioSession configuration to AppDelegate
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-29 15:09:16 +02:00
Arkadiusz Fal
e912d910bc
Merge pull request #754 from stonerl/fix-mpv-crash-on-macos
fix mpv crashing on macOS
2024-08-27 07:56:03 +02:00
Toni Förster
278bc343c2
fix mpv crashing on macOS
fixes #712

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-27 04:04:23 +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
Arkadiusz Fal
21f21cc944
Merge pull request #749 from stonerl/fix-chapter-regression
fix regression and improve curentChapter handling
2024-08-26 08:16:45 +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
Toni Förster
a45522f710
Improved stream resolution handling
Invidious now reports the actual resolution and doesn’t hardcode them anymore.

See: https://github.com/iv-org/invidious/pull/4586

- Extended the list of possible resolutions in the StreamModel
- trigger videoLoadFailureHandler if no streams are available
- more logging for backend.bestPlayable

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-25 17:23:04 +02:00
Arkadiusz Fal
3f871bce2c Fix possible crashes 2024-08-24 17:52:35 +02:00
Arkadiusz Fal
13d4a592bc
Merge pull request #570 from stonerl/close-fullscreen-on-end
add option to exit fullscreen on end
2024-08-24 12:16:26 +02:00
Toni Förster
8e97d3f42f
set playingFullscreen to proper value
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-20 22:56:55 +02:00
Toni Förster
64a18678ce
add option to exit fullscreen on end 2024-08-20 22:19:19 +02:00
Toni Förster
522aecfbc1
only updateWatch status while video is playing
This should circumvent edge cases where videos are marked as watch when they failed to play back.

Fixes #660

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-08-20 22:10:35 +02:00
Arkadiusz Fal
89dfbdb5c7 Fix swiftformat offenses 2024-07-06 11:48:49 +02:00
Toni Förster
9e05909659 fix duplicated share button
fixes #691

add `--initial-audio-sync=<yes|no>` to MPV settings. Might fix #690 but needs to be toggled by the user. We leave the standard settings.

Also added links to the icons on macOS.
2024-07-06 11:35:21 +02:00
Arkadiusz Fal
03e4c6d4e6
Merge pull request #689 from stonerl/more-mpv-settings
MPV: speed up playback start
2024-05-23 11:41:56 +02:00
Arkadiusz Fal
ae9aa6fac7
Merge branch 'main' into add-user-agent-to-header 2024-05-23 11:37:46 +02:00
Arkadiusz Fal
2f4fb9fc67
Merge pull request #684 from stonerl/better-caption-handling
Improved Captions handling
2024-05-23 11:37:03 +02:00
Toni Förster
e44c7f84c8
MPV: speed up playback start
We initialize MPV with more options so it does not have to guess. This dramatically speeds up playback start.
2024-05-23 10:53:45 +02:00
Toni Förster
108b4de483
allow user to choose captions color 2024-05-20 17:50:47 +02:00
Toni Förster
96df7fdec5
let the user select caption size 2024-05-20 15:47:35 +02:00
Toni Förster
4fa5a15ad4
fallback language for captions 2024-05-20 14:42:24 +02:00
Toni Förster
4db02b2638
Improved Captions handling
New options for captions in `Settings-Player`:

- Always show captions
- Default language

User can now select whether they want to show captions automatically when the video starts, and select the language.

Captions selector now shows proper name -> `English (en)` instead of only `en`
2024-05-20 03:50:51 +02:00
Toni Förster
2e9cceafa5
Add User-Agent to request
We generate a User-Agent for the platform we are running on and add it to the URLTester requests and also to MPV and AVPlayer
2024-05-19 13:46:14 +02:00
Toni Förster
fa09b2021c
speed up sorting for Stream
This should help to start playback a bit faster.
2024-05-19 12:39:47 +02:00
Toni Förster
43fc9e20c0
Advanced Settings: cache-pause-initial
`cache-pause-initial` status can now be selected by the user.

Also, on macOS and iOS, a link next to the option leads the user to the info on the mpv website.
2024-05-19 03:50:33 +02:00
Arkadiusz Fal
896d46d0cf
Merge pull request #662 from stonerl/piped-proxy
Conditional proxying
2024-05-18 11:42:11 +02:00
Toni Förster
e35f8b7892
Snappy UI - Offloading non UI task to background threads
This gives a huge increase in perceived performance. The UI is now much more responsive since some tasks are run in the background and don't block the UI anymore.
2024-05-17 21:36:02 +02:00
Toni Förster
6eba2a45c8
Conditional proxying
I added a new feature. When instances are not proxied, Yattee first checks the URL to make sure it is not a restricted video. Usually, music videos and sports content can only be played back by the same IP address that requested the URL in the first place. That is why some videos do not play when the proxy is disabled.

This approach has multiple advantages. First and foremost, It reduced the load on Invidious/Piped instances, since users can now directly access the videos without going through the instance, which might be severely bandwidth limited. Secondly, users don't need to manually turn on the proxy when they want to watch IP address bound content, since Yattee automatically proxies such content.

Furthermore, adding the proxy option allows mitigating some severe playback issues with invidious instances. Invidious by default returns proxied URLs for videos, and due to some bug in the Invidious proxy, scrubbing or continuing playback at a random timestamp can lead to severe wait times for the users.

This should fix numerous playback issues: #666, #626, #590, #585, #498, #457, #400
2024-05-16 19:35:31 +02:00
Arkadiusz Fal
4ce9dc6729 Fix build issues 2024-05-16 19:05:00 +02:00
Arkadiusz Fal
8a7e4c84b5
Merge pull request #653 from stonerl/mpvkit-0-38-0
upgrade to mpvkit-0.38.0
2024-05-16 18:24:41 +02:00
Arkadiusz Fal
c6724472a6
Merge pull request #667 from stonerl/hls-set-target-quality
HLS: set target bitrate / AVPlayer: higher resolution
2024-05-16 18:23:05 +02:00
Arkadiusz Fal
201de81351
Merge pull request #650 from stonerl/rework-qualitiy-settings
Rework qualitiy settings
2024-05-16 18:22:58 +02:00
Arkadiusz Fal
b9649b6356
Merge pull request #651 from stonerl/time-reset-on-stream-change
preserve time on stream change
2024-05-16 18:20:19 +02:00
Arkadiusz Fal
d9aa5105fa
Merge pull request #636 from stonerl/captions
fix handling and displaying captions
2024-05-16 18:18:49 +02:00
Arkadiusz Fal
7b484e80b8
Merge pull request #646 from stonerl/EOF-start-playback-again
Restart finished video
2024-05-16 18:17:13 +02:00
Toni Förster
b54044cbc5
HLS: set target bitrate / AVPlayer: higher resolution
HLS: try matching the set resolution. This works okay with AVPlayer. With MPV it is hit and miss, most of the time MPV targets the highest available bitrate, instead of the set bitrate.

AVPlayer now supports higher resolution up to 1080p60.
2024-05-13 07:54:24 +02:00
Toni Förster
fba01e35a3
apply best resolution from non HLS to HLS stream
This makes sure that HLS Streams can be compared with non HLS streams, otherwise HLS would have been the first selected since the maxResolution.value might have been higher then what could actually be the highest resolution served.
2024-05-11 14:08:40 +02:00
Toni Förster
7b7f877fa5
upgrade to mpvkit-0.38.0
subtitles are working gain (was broken with 0.37.0)
2024-05-03 17:08:30 +02:00