|
|
@ -41,7 +41,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
// RTCMTLVideoView requires the MTKView class, available only in iOS9+
|
|
|
|
// RTCMTLVideoView requires the MTKView class, available only in iOS9+
|
|
|
|
// So check that it exists before proceeding.
|
|
|
|
// So check that it exists before proceeding.
|
|
|
|
if ([MTKView class]) {
|
|
|
|
if ([MTKView class]) {
|
|
|
|
_videoRenderer = [[RTCMTLVideoView alloc] initWithFrame:CGRectZero];
|
|
|
|
RTCMTLVideoView *rtcMetalView = [[RTCMTLVideoView alloc] initWithFrame:CGRectZero];
|
|
|
|
|
|
|
|
rtcMetalView.videoContentMode = UIViewContentModeScaleAspectFill;
|
|
|
|
|
|
|
|
_videoRenderer = rtcMetalView;
|
|
|
|
[self addSubview:_videoRenderer];
|
|
|
|
[self addSubview:_videoRenderer];
|
|
|
|
[_videoRenderer autoPinEdgesToSuperviewEdges];
|
|
|
|
[_videoRenderer autoPinEdgesToSuperviewEdges];
|
|
|
|
// HACK: Although RTCMTLVideo view is positioned to the top edge of the screen
|
|
|
|
// HACK: Although RTCMTLVideo view is positioned to the top edge of the screen
|
|
|
|