A cheap attempt at a native Bluesky client for Android
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ComposeView: fix video rendering

geesawra 7b7941ee 6e282191

+51 -10
+2 -2
.idea/deploymentTargetSelector.xml
··· 4 4 <selectionStates> 5 5 <SelectionState runConfigName="app"> 6 6 <option name="selectionMode" value="DROPDOWN" /> 7 - <DropdownSelection timestamp="2025-10-02T20:10:03.298201200Z"> 7 + <DropdownSelection timestamp="2025-10-04T09:44:47.288588Z"> 8 8 <Target type="DEFAULT_BOOT"> 9 9 <handle> 10 - <DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\micro\.android\avd\Medium_Phone.avd" /> 10 + <DeviceId pluginId="LocalEmulator" identifier="path=/Users/gsora/.android/avd/Medium_Phone.avd" /> 11 11 </handle> 12 12 </Target> 13 13 </DropdownSelection>
+49 -8
app/src/main/java/industries/geesawra/monarch/ComposeView.kt
··· 63 63 import androidx.compose.ui.graphics.Color 64 64 import androidx.compose.ui.platform.LocalSoftwareKeyboardController 65 65 import androidx.compose.ui.unit.dp 66 + import androidx.media3.common.MimeTypes 66 67 import industries.geesawra.monarch.datalayer.SkeetData 67 68 import industries.geesawra.monarch.datalayer.TimelineViewModel 69 + import io.sanghun.compose.video.RepeatMode 70 + import io.sanghun.compose.video.VideoPlayer 71 + import io.sanghun.compose.video.controller.VideoPlayerControllerConfig 72 + import io.sanghun.compose.video.uri.VideoPlayerMediaItem 68 73 import kotlinx.coroutines.CoroutineScope 69 74 import kotlinx.coroutines.launch 70 75 ··· 259 264 .fillMaxWidth() 260 265 .padding(vertical = 8.dp) 261 266 ) { 262 - PostImageGallery( 263 - modifier = Modifier 264 - .fillMaxWidth() // Gallery should fill card width 265 - .padding(8.dp), 266 - images = mediaSelected.value.keys.map { uri -> 267 - Image(url = uri.toString(), alt = "Selected media") 268 - }, 269 - ) 267 + when (mediaSelectedIsVideo.value) { 268 + false -> PostImageGallery( 269 + modifier = Modifier 270 + .fillMaxWidth() // Gallery should fill card width 271 + .padding(8.dp), 272 + images = mediaSelected.value.keys.map { uri -> 273 + Image(url = uri.toString(), alt = "Selected media") 274 + }, 275 + ) 276 + 277 + true -> VideoPlayer( 278 + mediaItems = listOf( 279 + VideoPlayerMediaItem.NetworkMediaItem( 280 + url = mediaSelected.value.keys.first().toString(), 281 + mimeType = MimeTypes.APPLICATION_M3U8, 282 + ) 283 + ), 284 + handleLifecycle = false, 285 + autoPlay = false, 286 + usePlayerController = true, 287 + enablePip = false, 288 + handleAudioFocus = true, 289 + controllerConfig = VideoPlayerControllerConfig( 290 + showSpeedAndPitchOverlay = false, 291 + showSubtitleButton = false, 292 + showCurrentTimeAndTotalTime = true, 293 + showBufferingProgress = false, 294 + showForwardIncrementButton = true, 295 + showBackwardIncrementButton = true, 296 + showBackTrackButton = false, 297 + showNextTrackButton = false, 298 + showRepeatModeButton = true, 299 + controllerShowTimeMilliSeconds = 5_000, 300 + controllerAutoShow = true, 301 + showFullScreenButton = true, 302 + ), 303 + volume = 0.5f, // volume 0.0f to 1.0f 304 + repeatMode = RepeatMode.NONE, // or RepeatMode.ALL, RepeatMode.ONE 305 + modifier = Modifier 306 + .fillMaxSize() 307 + .heightIn(max = 500.dp) 308 + .padding(8.dp), 309 + ) 310 + } 270 311 } 271 312 } 272 313