Skip to content

Commit b1aeb6d

Browse files
committed
docs(README.md): add compose package info
1 parent af34151 commit b1aeb6d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ Get StreamPack core latest artifacts on Maven Central:
1818
```groovy
1919
dependencies {
2020
implementation 'io.github.thibaultbee.streampack:streampack-core:3.1.0'
21-
// For UI (incl. PreviewView)
21+
// For xml UI (incl. PreviewView)
2222
implementation 'io.github.thibaultbee.streampack:streampack-ui:3.1.0'
23+
// Or compose UI (incl. SourcePreview)
24+
implementation 'io.github.thibaultbee.streampack:streampack-compose:3.1.0'
2325
// For services (incl. screen capture/media projection service)
2426
implementation 'io.github.thibaultbee.streampack:streampack-services:3.1.0'
2527
// For RTMP
@@ -150,6 +152,8 @@ minutes, you will be able to stream live video to your server.
150152

151153
5. Inflates the preview with the streamer
152154

155+
Either `xml` UI
156+
153157
```kotlin
154158
val streamer = cameraSingleStreamer(context = requireContext()) // Already instantiated streamer
155159
val preview = findViewById<PreviewView>(R.id.preview) // Already inflated preview
@@ -166,6 +170,16 @@ minutes, you will be able to stream live video to your server.
166170
streamer.startPreview(preview)
167171
```
168172

173+
Or Compose UI
174+
175+
```kotlin
176+
val streamer = cameraSingleStreamer(context = requireContext()) // Already instantiated streamer
177+
178+
Box {
179+
SourcePreview(streamer, modifier = Modifier.fillMaxSize())
180+
}
181+
```
182+
169183
6. Sets the device orientation
170184

171185
```kotlin

0 commit comments

Comments
 (0)