forked from mirrors/linphone-iphone
Landcape handling of video self view in 1-1 calls
This commit is contained in:
parent
5ab6a7ce1b
commit
ad9163320c
3 changed files with 22 additions and 2 deletions
|
|
@ -70,6 +70,14 @@ extension UIView {
|
|||
return self
|
||||
}
|
||||
|
||||
func updateSize(w:CGFloat,h:CGFloat) -> UIView {
|
||||
snp.updateConstraints { (make) in
|
||||
make.width.equalTo(w)
|
||||
make.height.equalTo(h)
|
||||
}
|
||||
return self
|
||||
}
|
||||
|
||||
func height(_ h:CGFloat) -> UIView {
|
||||
snp.makeConstraints { (make) in
|
||||
make.height.equalTo(h)
|
||||
|
|
|
|||
|
|
@ -238,8 +238,8 @@ class ActiveCallView: UIView { // = currentCall
|
|||
avatar.square(Avatar.diameter_for_call_views_land).center().done()
|
||||
} else {
|
||||
avatar.square(Avatar.diameter_for_call_views).center().done()
|
||||
|
||||
}
|
||||
localVideo.updateSizeConstraint()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
|
|
|
|||
|
|
@ -73,8 +73,20 @@ class LocalVideoView: UIView {
|
|||
setSizeConstraint()
|
||||
}
|
||||
|
||||
func getSize() -> CGSize {
|
||||
let w = UIDevice.current.orientation.isLandscape ? width*aspect_ratio : width
|
||||
let h = !UIDevice.current.orientation.isLandscape ? width*aspect_ratio : width
|
||||
return CGSize(width: w,height: h)
|
||||
}
|
||||
|
||||
func setSizeConstraint() {
|
||||
size(w: width, h: width*aspect_ratio).done()
|
||||
let targetSsize = getSize()
|
||||
size(w: targetSsize.width, h: targetSsize.height).done()
|
||||
}
|
||||
|
||||
func updateSizeConstraint() {
|
||||
let targetSsize = getSize()
|
||||
updateSize(w: targetSsize.width, h: targetSsize.height).done()
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue