style(audio-rooms): import-and-use instead of inline FQNs
Replace inline `com.vitorpamplona.…` references in code + KDoc with imports + the short class name across the audio-rooms surface. KDoc references that would have introduced an `ui` → `model` import cycle (e.g. NestsServerListState referring to CreateAudioRoomViewModel) are demoted to plain text instead of clickable `[Class]` links. No behavioural change.
This commit is contained in:
@@ -23,8 +23,10 @@ package com.vitorpamplona.nestsclient
|
||||
import com.vitorpamplona.nestsclient.audio.AudioCapture
|
||||
import com.vitorpamplona.nestsclient.audio.OpusEncoder
|
||||
import com.vitorpamplona.nestsclient.moq.SubscribeHandle
|
||||
import com.vitorpamplona.nestsclient.moq.lite.MoqLiteSession
|
||||
import com.vitorpamplona.nestsclient.transport.WebTransportException
|
||||
import com.vitorpamplona.nestsclient.transport.WebTransportFactory
|
||||
import com.vitorpamplona.nestsclient.transport.WebTransportSession
|
||||
import com.vitorpamplona.quartz.nip01Core.signers.NostrSigner
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
@@ -35,14 +37,13 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||
*
|
||||
* 1. Mint a JWT — POST `<authBase>/auth` with NIP-98 + namespace body
|
||||
* (see [NestsClient.mintToken]).
|
||||
* 2. Open a [com.vitorpamplona.nestsclient.transport.WebTransportSession]
|
||||
* against the [room.endpoint] via [transport]. The path is
|
||||
* `/<moqNamespace>?jwt=<token>` — moq-rs treats the URL path as
|
||||
* `claims.root` and reads the JWT from `?jwt=`.
|
||||
* 3. Wrap the WT session in a [com.vitorpamplona.nestsclient.moq.lite.MoqLiteSession].
|
||||
* moq-lite Lite-03 has NO in-band SETUP message — the WT handshake
|
||||
* itself is the handshake, version is selected by the ALPN
|
||||
* `moq-lite-03`.
|
||||
* 2. Open a [WebTransportSession] against the [room.endpoint] via
|
||||
* [transport]. The path is `/<moqNamespace>?jwt=<token>` — moq-rs
|
||||
* treats the URL path as `claims.root` and reads the JWT from
|
||||
* `?jwt=`.
|
||||
* 3. Wrap the WT session in a [MoqLiteSession]. moq-lite Lite-03 has
|
||||
* NO in-band SETUP message — the WT handshake itself is the
|
||||
* handshake, version is selected by the ALPN `moq-lite-03`.
|
||||
*
|
||||
* The returned [NestsListener] is in state [NestsListenerState.Connected];
|
||||
* if any step fails, the listener is returned in
|
||||
@@ -110,8 +111,7 @@ suspend fun connectNestsListener(
|
||||
// `moq-lite-03`.
|
||||
val moq =
|
||||
try {
|
||||
com.vitorpamplona.nestsclient.moq.lite.MoqLiteSession
|
||||
.client(webTransport, scope)
|
||||
MoqLiteSession.client(webTransport, scope)
|
||||
} catch (t: Throwable) {
|
||||
runCatching { webTransport.close(0, "moq-lite session init failed") }
|
||||
state.value = NestsListenerState.Failed("moq-lite session init failed: ${t.message}", t)
|
||||
@@ -225,8 +225,7 @@ suspend fun connectNestsSpeaker(
|
||||
// path — version is selected by the `moq-lite-03` ALPN.
|
||||
val moq =
|
||||
try {
|
||||
com.vitorpamplona.nestsclient.moq.lite.MoqLiteSession
|
||||
.client(webTransport, scope)
|
||||
MoqLiteSession.client(webTransport, scope)
|
||||
} catch (t: Throwable) {
|
||||
runCatching { webTransport.close(0, "moq-lite session init failed") }
|
||||
state.value = NestsSpeakerState.Failed("moq-lite session init failed: ${t.message}", t)
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
*/
|
||||
package com.vitorpamplona.nestsclient
|
||||
|
||||
import com.vitorpamplona.nestsclient.moq.MoqProtocolException
|
||||
import com.vitorpamplona.nestsclient.moq.MoqSession
|
||||
import com.vitorpamplona.nestsclient.moq.SubscribeFilter
|
||||
import com.vitorpamplona.nestsclient.moq.SubscribeHandle
|
||||
import com.vitorpamplona.nestsclient.moq.TrackNamespace
|
||||
import com.vitorpamplona.nestsclient.transport.WebTransportSession
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
@@ -45,8 +47,7 @@ interface NestsListener {
|
||||
* Opus stream under the namespace `["nests", <roomId>]` with the
|
||||
* speaker's pubkey hex as the track name.
|
||||
*
|
||||
* @throws com.vitorpamplona.nestsclient.moq.MoqProtocolException if the
|
||||
* publisher rejects the subscription.
|
||||
* @throws MoqProtocolException if the publisher rejects the subscription.
|
||||
* @throws IllegalStateException if the listener is not in [NestsListenerState.Connected].
|
||||
*/
|
||||
suspend fun subscribeSpeaker(speakerPubkeyHex: String): SubscribeHandle
|
||||
@@ -107,8 +108,7 @@ sealed class NestsListenerState {
|
||||
* MoQ-transport target.
|
||||
*
|
||||
* Delegates to a [MoqSession] already set up on a
|
||||
* [com.vitorpamplona.nestsclient.transport.WebTransportSession];
|
||||
* construction does NOT open the transport.
|
||||
* [WebTransportSession]; construction does NOT open the transport.
|
||||
*/
|
||||
class DefaultNestsListener internal constructor(
|
||||
private val session: MoqSession,
|
||||
|
||||
@@ -23,6 +23,7 @@ package com.vitorpamplona.nestsclient
|
||||
import com.vitorpamplona.nestsclient.audio.AudioCapture
|
||||
import com.vitorpamplona.nestsclient.audio.AudioRoomBroadcaster
|
||||
import com.vitorpamplona.nestsclient.audio.OpusEncoder
|
||||
import com.vitorpamplona.nestsclient.moq.MoqProtocolException
|
||||
import com.vitorpamplona.nestsclient.moq.MoqSession
|
||||
import com.vitorpamplona.nestsclient.moq.TrackNamespace
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
@@ -52,8 +53,7 @@ interface NestsSpeaker {
|
||||
*
|
||||
* @throws IllegalStateException if a broadcast is already running on
|
||||
* this speaker or the session is not [NestsSpeakerState.Connected].
|
||||
* @throws com.vitorpamplona.nestsclient.moq.MoqProtocolException if the
|
||||
* peer rejects the ANNOUNCE.
|
||||
* @throws MoqProtocolException if the peer rejects the ANNOUNCE.
|
||||
*/
|
||||
suspend fun startBroadcasting(): BroadcastHandle
|
||||
|
||||
|
||||
Reference in New Issue
Block a user