Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-ios
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-ios
Commits
6e37f0d1
Commit
6e37f0d1
authored
4 years ago
by
Kateryna Kostiuk
Committed by
Kateryna Kostiuk
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
call: stop camera when peer refuse call
Gitlab:
#136
Change-Id: I67831e9603380a516a06f8baf2a177c28d042a02
parent
c606eadf
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ring/Ring/Calls/CallViewModel.swift
+19
-9
19 additions, 9 deletions
Ring/Ring/Calls/CallViewModel.swift
with
19 additions
and
9 deletions
Ring/Ring/Calls/CallViewModel.swift
+
19
−
9
View file @
6e37f0d1
...
@@ -84,6 +84,10 @@ class CallViewModel: Stateable, ViewModel {
...
@@ -84,6 +84,10 @@ class CallViewModel: Stateable, ViewModel {
if
oldValue
!=
nil
{
if
oldValue
!=
nil
{
return
return
}
}
if
!
(
self
.
call
?
.
isAudioOnly
??
true
)
{
self
.
videoService
.
startVideoCaptureBeforeCall
()
}
self
.
subscribeToCallFinished
()
self
.
callService
.
currentConferenceEvent
self
.
callService
.
currentConferenceEvent
.
asObservable
()
.
asObservable
()
.
filter
({
[
weak
self
]
conference
->
Bool
in
.
filter
({
[
weak
self
]
conference
->
Bool
in
...
@@ -103,8 +107,6 @@ class CallViewModel: Stateable, ViewModel {
...
@@ -103,8 +107,6 @@ class CallViewModel: Stateable, ViewModel {
}
}
let
isModerator
=
self
.
callService
.
isModerator
(
participantId
:
account
.
jamiId
,
inConference
:
conf
.
conferenceID
)
let
isModerator
=
self
.
callService
.
isModerator
(
participantId
:
account
.
jamiId
,
inConference
:
conf
.
conferenceID
)
if
isModerator
!=
self
.
containerViewModel
?
.
isConference
{
if
isModerator
!=
self
.
containerViewModel
?
.
isConference
{
// guard let updatedCall = self.callService.call(callID: call.callId) else { return }
// self.call = updatedCall
self
.
containerViewModel
?
.
isConference
=
isModerator
self
.
containerViewModel
?
.
isConference
=
isModerator
self
.
conferenceMode
.
accept
(
isModerator
)
self
.
conferenceMode
.
accept
(
isModerator
)
}
}
...
@@ -183,9 +185,6 @@ class CallViewModel: Stateable, ViewModel {
...
@@ -183,9 +185,6 @@ class CallViewModel: Stateable, ViewModel {
var
rendererId
=
""
var
rendererId
=
""
lazy
var
capturedFrame
:
Observable
<
UIImage
?
>
=
{
lazy
var
capturedFrame
:
Observable
<
UIImage
?
>
=
{
if
!
(
self
.
call
?
.
isAudioOnly
??
true
)
{
videoService
.
startVideoCaptureBeforeCall
()
}
return
videoService
.
capturedVideoFrame
.
asObservable
()
.
map
({
frame
in
return
videoService
.
capturedVideoFrame
.
asObservable
()
.
map
({
frame
in
return
frame
return
frame
})
})
...
@@ -213,10 +212,6 @@ class CallViewModel: Stateable, ViewModel {
...
@@ -213,10 +212,6 @@ class CallViewModel: Stateable, ViewModel {
return
!
hide
return
!
hide
}
}
}
}
if
hide
{
self
?
.
videoService
.
setCameraOrientation
(
orientation
:
UIDevice
.
current
.
orientation
)
self
?
.
callsProvider
.
stopCall
(
callUUID
:
call
.
callUUID
)
}
return
hide
return
hide
})
})
}()
}()
...
@@ -638,6 +633,21 @@ extension CallViewModel {
...
@@ -638,6 +633,21 @@ extension CallViewModel {
func
showDialpad
()
{
func
showDialpad
()
{
self
.
stateSubject
.
onNext
(
ConversationState
.
showDialpad
(
inCall
:
true
))
self
.
stateSubject
.
onNext
(
ConversationState
.
showDialpad
(
inCall
:
true
))
}
}
func
subscribeToCallFinished
()
{
dismisVC
.
share
()
.
filter
{
dismised
in
return
dismised
}
.
subscribe
{
[
weak
self
]
_
in
guard
let
self
=
self
,
let
call
=
self
.
call
else
{
return
}
self
.
videoService
.
stopCapture
()
self
.
videoService
.
setCameraOrientation
(
orientation
:
UIDevice
.
current
.
orientation
)
self
.
callsProvider
.
stopCall
(
callUUID
:
call
.
callUUID
)
}
.
disposed
(
by
:
self
.
disposeBag
)
}
}
}
// MARK: conference layout
// MARK: conference layout
extension
CallViewModel
{
extension
CallViewModel
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment