Skip to content

Commit

Permalink
Calls remote view display.
Browse files Browse the repository at this point in the history
Added remote peer label & fixed aspect ratio.
  • Loading branch information
aforge committed Feb 16, 2023
1 parent 7de92b2 commit 515ba4c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
36 changes: 32 additions & 4 deletions Tinodios/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,30 @@
<constraint firstAttribute="width" constant="144" id="Yiy-23-PQb"/>
</constraints>
</view>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" alpha="0.59999999999999998" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Alice Hatter" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jrt-hR-wyQ" userLabel="Peer Name Remote Label" customClass="PaddedLabel" customModule="Tinodios" customModuleProvider="target">
<rect key="frame" x="20.000000000000007" y="604" width="102.66666666666669" height="24"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle3"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="topInset">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="bottomInset">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="leftInset">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="rightInset">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalCentering" alignment="center" spacing="32" translatesAutoresizingMaskIntoConstraints="NO" id="MNU-G3-XGy" userLabel="Controls Stack">
<rect key="frame" x="47" y="648" width="320" height="56"/>
<subviews>
Expand Down Expand Up @@ -2033,10 +2057,13 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Oea-7Y-Tvd" firstAttribute="top" secondItem="dLA-fr-G0I" secondAttribute="bottom" constant="8" id="1AB-Ab-rgy"/>
<constraint firstItem="o1j-Ss-Jhj" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="jrt-hR-wyQ" secondAttribute="trailing" symbolic="YES" id="1kX-Ew-U5T"/>
<constraint firstItem="iFL-dy-gre" firstAttribute="trailing" secondItem="84I-vF-4hU" secondAttribute="trailing" id="45Q-fk-Ygh"/>
<constraint firstItem="84I-vF-4hU" firstAttribute="bottom" secondItem="iFL-dy-gre" secondAttribute="bottom" id="4aP-e8-fkz"/>
<constraint firstItem="jrt-hR-wyQ" firstAttribute="bottom" secondItem="MNU-G3-XGy" secondAttribute="top" constant="-20" id="5x9-ee-MGx"/>
<constraint firstItem="iFL-dy-gre" firstAttribute="leading" secondItem="84I-vF-4hU" secondAttribute="leading" id="9n4-dL-fLm"/>
<constraint firstItem="MNU-G3-XGy" firstAttribute="top" secondItem="o1j-Ss-Jhj" secondAttribute="bottom" constant="12" id="CQP-fe-gh5"/>
<constraint firstItem="jrt-hR-wyQ" firstAttribute="leading" secondItem="iFL-dy-gre" secondAttribute="leading" constant="20" id="HwM-sL-lt2"/>
<constraint firstItem="84I-vF-4hU" firstAttribute="trailing" secondItem="o1j-Ss-Jhj" secondAttribute="trailing" constant="8" id="JAh-bI-ZaP"/>
<constraint firstItem="84I-vF-4hU" firstAttribute="bottom" secondItem="MNU-G3-XGy" secondAttribute="bottom" constant="12" id="Kzr-de-oLC"/>
<constraint firstItem="MNU-G3-XGy" firstAttribute="centerX" secondItem="jBZ-LQ-eXz" secondAttribute="centerX" id="P18-pW-oBI"/>
Expand All @@ -2058,6 +2085,7 @@
<outlet property="micToggleButton" destination="XcR-2C-7J9" id="1Lw-VT-3eq"/>
<outlet property="peerAvatarImageView" destination="Oea-7Y-Tvd" id="5bs-UP-qNj"/>
<outlet property="peerNameLabel" destination="dLA-fr-G0I" id="PvA-py-Bit"/>
<outlet property="peerNameRemoteVideoLabel" destination="jrt-hR-wyQ" id="oAQ-bH-Mjt"/>
<outlet property="remoteView" destination="iFL-dy-gre" id="gwx-Nt-5Au"/>
<outlet property="speakerToggleButton" destination="4cw-7z-AEP" id="vzi-WT-aci"/>
<outlet property="videoToggleButton" destination="gUh-4V-ume" id="KJI-lG-VDJ"/>
Expand Down Expand Up @@ -2569,14 +2597,14 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Delete Messages" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="wnZ-ve-5xb">
<rect key="frame" x="46" y="0.0" width="329.66666666666669" height="44"/>
<rect key="frame" x="50" y="0.0" width="325.66666666666669" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="gCN-hc-uhY">
<rect key="frame" x="20" y="16.333333333333332" width="11" height="11"/>
<rect key="frame" x="20" y="15" width="15" height="14"/>
<autoresizingMask key="autoresizingMask"/>
<imageReference key="image" image="xmark.bubble" symbolScale="medium"/>
<preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="medium" weight="regular"/>
Expand Down Expand Up @@ -3125,7 +3153,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<view key="tableFooterView" contentMode="scaleToFill" id="xIw-r0-6Pv" userLabel="Footer to hide separators for empty rows">
<rect key="frame" x="0.0" y="-20" width="414" height="0.0"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="0.0"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<accessibility key="accessibilityConfiguration" label="Footer">
<accessibilityTraits key="traits" notEnabled="YES"/>
Expand Down Expand Up @@ -4133,7 +4161,7 @@
<image name="vc.fill" width="154" height="132"/>
<image name="xmark.bin" catalog="system" width="128" height="92"/>
<image name="xmark.bin.fill" catalog="system" width="128" height="92"/>
<image name="xmark.bubble" width="11" height="11"/>
<image name="xmark.bubble" width="15" height="14"/>
<image name="xmark.circle" catalog="system" width="128" height="123"/>
<systemColor name="groupTableViewBackgroundColor">
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down
7 changes: 6 additions & 1 deletion Tinodios/CallViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ class CallViewController: UIViewController {

@IBOutlet weak var peerNameLabel: PaddedLabel!
@IBOutlet weak var peerAvatarImageView: RoundImageView!
@IBOutlet weak var peerNameRemoteVideoLabel: PaddedLabel!

@IBOutlet weak var dialingAnimationContainer: UIView!

Expand Down Expand Up @@ -643,6 +644,8 @@ class CallViewController: UIViewController {
if let topic = topic {
peerNameLabel.text = topic.pub?.fn
peerNameLabel.sizeToFit()
peerNameRemoteVideoLabel.text = peerNameLabel.text
peerNameRemoteVideoLabel.sizeToFit()
peerAvatarImageView.set(pub: topic.pub, id: topic.name, deleted: false)
}
}
Expand Down Expand Up @@ -852,7 +855,7 @@ class CallViewController: UIViewController {
let localRenderer = RTCMTLVideoView(frame: self.localView.frame)
let remoteRenderer = RTCMTLVideoView(frame: self.remoteView.frame)
localRenderer.videoContentMode = .scaleAspectFit
remoteRenderer.videoContentMode = .scaleAspectFit
remoteRenderer.videoContentMode = .scaleAspectFill
#else
// Using OpenGLES for the rest
let localRenderer = RTCEAGLVideoView(frame: self.localView.frame)
Expand All @@ -868,6 +871,7 @@ class CallViewController: UIViewController {
self.remoteRenderer = remoteRenderer
if self.isAudioOnlyCall {
remoteView.isHidden = true
peerNameRemoteVideoLabel.isHidden = true
localView.isHidden = true
}
}
Expand Down Expand Up @@ -1053,6 +1057,7 @@ extension CallViewController: WebRTCClientDelegate {
func toggleRemoteVideo(remoteLive: Bool) {
DispatchQueue.main.async {
self.remoteView.isHidden = !remoteLive
self.peerNameRemoteVideoLabel.isHidden = !remoteLive
self.peerNameLabel.alpha = !remoteLive ? 1 : 0
self.peerAvatarImageView.alpha = !remoteLive ? 1 : 0
}
Expand Down

0 comments on commit 515ba4c

Please # to comment.