-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add playback HUD support #893
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
waliid
reviewed
May 24, 2024
Co-authored-by: Walid Kayhal <[email protected]>
Co-authored-by: Walid Kayhal <[email protected]>
On the Mac app (designed for iPad) we have the following log which can be considered as a log noise.
|
This reverts commit 40c4771.
waliid
approved these changes
May 24, 2024
4 tasks
We could submit official Playback HUD support for iOS to Apple but let us wait a bit and see what happens at WWDC. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR extends playback HUD support officially available for tvOS to iOS.
Technical considerations
The playback HUD overlay, which can be enabled from the tvOS developer settings, is displayed using a private text layer class
AVNetworkPlaybackPerfHUDLayer
. After inspection with Hopper it appears that the appearance of this overlay is governed by a preferencecom.apple.avfoundation.videoperformancehud.plist
that can be manipulated with:With closer inspection of
-[AVNetworkPlaybackPerfHUDLayer getHudSetting]
in Hopper we can find that the following parameters are supported:enable
: Manages overlay visibility.color
: The text color (an integer) withyellow = 0
,green = 1
,red = 2
,blue = 3
andwhite
otherwise.xoffset
: The x-offset for the text.yoffset
: The y-offset for the text.fontsize
: The size of the font.interval
: The refresh interval.There are also
spatial
,opacity
andshow_complete_uri
parameters but these seem not to have significant use for us.The
AVNetworkPlaybackPerfHUDLayer
class is available for iOS as well but has no visible setting. We can display it by tweaking thecom.apple.avfoundation.videoperformancehud
user defaults but:-[AVNetworkPlaybackPerfHUDLayer updateHudWithDisplayString:]
which, if a fixed value is set (> 8), leads to various results on iOS / tvOS, also not consistent between simulator and device (on device the device scale is somehow omitted).We can thus deliver in-app playback HUD settings with a few limitations:
For these reasons, and since we are accessing a private preference property list, the feature should not be provided by the framework but only in the demo. People interested in testing their streams with Pillarbox can still enable the feature and copy / paste their stream URL in the demo for closer inspection.
Changes made
The PR adds demo settings for the playback HUD. This makes the playback HUD accessible on iOS as well and provides additional customization possibilities on tvOS:
Other parameters are less relevant and are not supported. A reset button is also provided to return to default settings (still reset anyway with the next app cold start).
A few other improvements have been made:
Checklist