diff --git a/example/build.gradle b/example/build.gradle index 6ac8db9..39316e7 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -74,7 +74,7 @@ dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3' implementation 'androidx.core:core-ktx:1.13.1' - implementation "com.squareup.okhttp3:okhttp:4.12.0" +// implementation "com.squareup.okhttp3:okhttp:4.12.0" implementation 'androidx.constraintlayout:constraintlayout:2.2.0-alpha13' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' diff --git a/example/libs/sellycloudsdk-1.0.0.aar b/example/libs/sellycloudsdk-1.0.0.aar index 7fce573..08cbf6f 100644 Binary files a/example/libs/sellycloudsdk-1.0.0.aar and b/example/libs/sellycloudsdk-1.0.0.aar differ diff --git a/example/src/main/java/com/demo/SellyCloudSDK/live/LivePlayActivity.kt b/example/src/main/java/com/demo/SellyCloudSDK/live/LivePlayActivity.kt index 5cc313d..4bb0b83 100644 --- a/example/src/main/java/com/demo/SellyCloudSDK/live/LivePlayActivity.kt +++ b/example/src/main/java/com/demo/SellyCloudSDK/live/LivePlayActivity.kt @@ -79,6 +79,7 @@ class LivePlayActivity : AppCompatActivity() { private var firstAudioFrameElapsedMs: Long? = null private var firstAudioFrameCostMs: Long? = null private var isLatencyChasingActive: Boolean = false + private var lastLatencyChasingSpeed: Float? = null private val logLines: ArrayDeque = ArrayDeque() private val logTimeFormat = SimpleDateFormat("HH:mm:ss.SSS", Locale.getDefault()) @@ -159,9 +160,17 @@ class LivePlayActivity : AppCompatActivity() { isLatencyChasingActive = true val speedText = String.format(Locale.US, "%.1f", speedRounded) logEvent("追帧开始: 速度=${speedText}x") + lastLatencyChasingSpeed = speedRounded + } else if (isChasing && isLatencyChasingActive) { + if (lastLatencyChasingSpeed == null || lastLatencyChasingSpeed != speedRounded) { + val speedText = String.format(Locale.US, "%.1f", speedRounded) + logEvent("追帧速率变化: 速度=${speedText}x") + lastLatencyChasingSpeed = speedRounded + } } else if (!isChasing && isLatencyChasingActive) { isLatencyChasingActive = false logEvent("追帧结束: 速度=1.0x") + lastLatencyChasingSpeed = null } } } @@ -661,6 +670,7 @@ class LivePlayActivity : AppCompatActivity() { firstAudioFrameElapsedMs = null firstAudioFrameCostMs = null isLatencyChasingActive = false + lastLatencyChasingSpeed = null logEvent("播放尝试开始") } diff --git a/settings.gradle b/settings.gradle index 270d4e9..0be60f9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -20,5 +20,5 @@ dependencyResolutionManagement { } } -rootProject.name = "SellyCLoudSDKExample" +rootProject.name = "SellyCloudSDKExample" include ':example'