This repository has no description
0

Configure Feed

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

feat: use explicit timestamps for better accuracy

+7 -2
+7 -2
sample/composeApp/src/commonMain/kotlin/com/nate/posedetection/App.kt
··· 187 187 } 188 188 } 189 189 190 + val frameMap: MutableMap<String,List<Long>> = mutableMapOf() 191 + 190 192 LaunchedEffect(url){ 191 193 val timestamps = listVideoFrameTimestamps(url) 192 - println("Timestamps: $timestamps") 194 + frameMap[url] = timestamps 193 195 } 194 196 195 197 LaunchedEffect(url, frame) { ··· 224 226 // Handle any error that may occur 225 227 e.printStackTrace() 226 228 } finally { 227 - (frame + 20L).also { 229 + val nextFrame = frameMap[url]?.let { frameTimeStamps -> 230 + frameTimeStamps.firstOrNull { it > frame} 231 + }?:(frame + 20L) 232 + nextFrame.also { 228 233 if (it < timeRange.second) { 229 234 frame = it 230 235 } else {