-
Notifications
You must be signed in to change notification settings - Fork 54
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
VIDEO-4517: Add Client Track Switch Off Control Support #156
VIDEO-4517: Add Client Track Switch Off Control Support #156
Conversation
* Subscribed track switch off is enabled by default * The app does not implement any specific manual controls, this is effectively the legacy behavior without maxTracks * Comment out usage of deprecated maxTracks property for now * No modifications to collection view cells yet * [skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good so far.
I wouldn't really be concerned about tests at this point because most of this is settings which we don't have tests for and I expect will be replaced by InAppSettingsKit
before long.
When the time comes we could consider unit tests for ConnectOptionsFactory
but I can take care of that.
UI tests are probably not practical right now for this feature.
Happy to help if the cell reuse stuff needs work.
VideoApp/VideoApp/Stores/AppSettings/SubscribedTrackSwitchOffMode.swift
Outdated
Show resolved
Hide resolved
@@ -528,7 +528,7 @@ | |||
</constraints> | |||
</view> | |||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="wU6-sZ-Ash"> | |||
<rect key="frame" x="10" y="690" width="404" height="172"/> | |||
<rect key="frame" x="0.0" y="690" width="414" height="172"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UICollectionView had a gap of 10 points on the leading edge but was flush to the trailing edge. I think this was just an unintended bug (it's not obvious until you have more than a screen full of cells).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I set this gap intentionally but not sure what desired UX really is to be honest. I'm good with this adjustment.
Probably how it should really work someday is the collection view has no gaps on either side and instead we use spacing inside of the collection view content at start and end. This way it looks good at start/end position and when scrolling (cells are not clipped before the edge of the display).
But I think the team wants to completely redo UX of this screen someday so best to tackle then.
Hi @timrozum, I continued to test this PR yesterday. What I noticed was that UICollectionViewDataSource prefetching is preventing some of the subscribed track switch off optimizations. Specifically, the behavior where cells can be opportunistically dequeued by UIKit before they come onscreen and are not recycled immediately after they go offscreen. I think the best way to manage rendering in the UICollectionView is to implement the delegate methods for cell display. I was wondering if you would be interested in taking a shot at it?
We should make sure that video starts / stops rendering within these methods. To me it is okay to keep the existing dequeue logic ( |
@ceaglest yeah I had looked at I guess |
Yes it is needed as well. To replicate, try scrolling a cell just offscreen and then back on. Typically the cell does not go through the reuse queue during this action but your delegate receives a |
Thanks great to know. |
* SubscribedTrackSwitchOffMode -> ClientTrackSwitchOffControl
I am curious if we would cut a feature branch for media optimizations in advance of the 4.5.0 release? This app should also be updated for VideoContentPreferences, which I think deserves a separate PR. |
# Conflicts: # Podfile.lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't run the changes locally but it looks like they will resolve the flickering issue. Thank you @timrozum. 👍
This PR adds support for Client Track Switch Off Control to the iOS Video App.
maxTracks
limitmaxTracks
property.Note: While testing this feature I ran into a background CPU usage crash which was resolved in #155.
Contributing to Twilio