-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Voice broadcast - live listening #7419
Voice broadcast - live listening #7419
Conversation
6aa494f
to
0d7a36a
Compare
0d7a36a
to
dd54b76
Compare
@Florian14 do you want to drop this commit? dd54b76 |
Yes I will remove it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work!
I have made a few remarks but I have not tested the code.
vector/src/main/java/im/vector/app/features/voicebroadcast/VoiceBroadcastPlayer.kt
Show resolved
Hide resolved
vector/src/main/java/im/vector/app/features/voicebroadcast/VoiceBroadcastPlayer.kt
Show resolved
Hide resolved
vector/src/main/java/im/vector/app/features/voicebroadcast/VoiceBroadcastPlayer.kt
Outdated
Show resolved
Hide resolved
import javax.inject.Inject | ||
|
||
class GetVoiceBroadcastStateUseCase @Inject constructor( | ||
private val session: Session, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please inject ActiveSessionHolder
here instead of a Session, since an instance of this will be injected in a Singleton.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be considering in another PR - we create #7423 to track this point
) { | ||
private val session | ||
get() = sessionHolder.getActiveSession() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use getSafeActiveSession
instead? The getActiveSession
may throw an exception. If we keep, maybe we should try/catch in the call sites of this variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be handled by #7423
import javax.inject.Inject | ||
|
||
class GetVoiceBroadcastStateUseCase @Inject constructor( | ||
private val session: Session, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it is usually preferable to use the ActiveSessionHolder
instead of the Session
component.
|
||
private val mediaPlayerScope = CoroutineScope(Dispatchers.IO) | ||
private val coroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought: you will see but you may have a hard time when trying to add unit tests on this class due to the usage of this coroutineScope
. Maybe in the future we may have to change the implementation of some methods.
82ef8e6
to
1004496
Compare
1004496
to
0a9f2bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved - #7423 has been created to improve session retrieving
SonarCloud Quality Gate failed. |
Is this based on voice notes (files) or WebRTC? |
Type of change
Content
Be able to listen to an ongoing voice broadcast
When a voice broadcast is live, trigger the play action will start listening to the last received chunk and wait for the new ones with a "buffering" state in the meantime.
Also, when the recording is paused, the current chunk is now stopped and sent to the room. Resume the recording will start a new chunk file.
Note: the UI will be improved in a dedicated PR for a better rendering of the listening state
Motivation and context
Continue #7127
Screenshots / GIFs
Tests
Tested devices
Checklist