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
··· 190 190 } 191 191 } 192 192 193 + val frameMap: MutableMap<String,List<Long>> = mutableMapOf() 194 + 193 195 LaunchedEffect(url){ 194 196 val timestamps = listVideoFrameTimestamps(url) 195 - println("Timestamps: $timestamps") 197 + frameMap[url] = timestamps 196 198 } 197 199 198 200 LaunchedEffect(url, frame) { ··· 220 222 // Handle any error that may occur 221 223 e.printStackTrace() 222 224 } finally { 223 - (frame + 20L).also { 225 + val nextFrame = frameMap[url]?.let { frameTimeStamps -> 226 + frameTimeStamps.firstOrNull { it > frame} 227 + }?:(frame + 20L) 228 + nextFrame.also { 224 229 if (it < timeRange.second) { 225 230 frame = it 226 231 } else {