Closed Shagans982 closed 3 years ago
Found the fix - not sure if this is an Xcode bug or a Twilio bug. Im running Xcode 12.5. Setting the contentMode
in code solves the issue. Apparently contentMode
being set from the Storyboard has no effect.
@Shagans982,
I looked into this this morning and this is a bug in TVIVideoView
. It appears that the specified contentMode
is overridden with UIViewContentModeScaleAspectFit
during the process of decoding the view from the storyboard.
The workaround you have at the moment is the valid suggested workaround. I will create an internal issue to resolve this so that properties set in the Storyboard are respected.
Ryan
@paynerc I also seem to be getting an issue when adding renderers. When I pass in a VideoView
(which does conform to the VideoRenderer
Protocol) it tells me it doesn't and crashes. Have you guys seen this before? Ive cleaned the project multiple times, reconnecting IBOutlets
etc and the issue still remains.
@paynerc Check this out - what is going on??
That looks very strange. How is the smallProviderVideoRenderer
configured in the Storyboard?
As a VideoView
- This implementation was working fine in 2.10. I simply renamed the class to VideoView
from TVIVideoView
Ah. That may be your problem. The framework is still ObjectiveC, but we use the NS_SWIFT_NAME
macro to expose the names in Swift in a more idiomatic fashion. I believe that you are still required to use the class name as it is defined in the framework, so in this instance it would still need to be TVIVideoView
in the storyboard editor.
Testing this locally, I see the following in the console output when I attempt to just use VideoView
as the class name in the Storyboard editor:
2021-06-23 13:58:53.944750-0400 TestApp[89274:2209861] [Storyboard] Unknown class VideoView in Interface Builder file.
OK that solved it - is this documented anywhere? I would have assumed the rename would have also been made to the underlying ObjC code as well. Keeping names consistent.
Im in the process of migrating over from 2.10.2 to 4.4 and my video frames used to fill simply by setting the
contentMode
toAspectFill
, now no matter what thecontentMode
is, it never fills the frame. I have constraints setup in the storyboard enforcing the view size but the camera preview crops. Any suggestions?