update
This commit is contained in:
@@ -173,7 +173,7 @@ class InteractiveLiveActivity : AppCompatActivity() {
|
||||
val token = getString(R.string.signaling_token).takeIf { it.isNotBlank() }
|
||||
val kiwiRsName = getString(R.string.signaling_kiwi_rsname).trim()
|
||||
beautyRenderer = FURenderer(this).also { it.setup() }
|
||||
fuFrameInterceptor = beautyRenderer?.let { FuVideoFrameInterceptor(it).apply {
|
||||
fuFrameInterceptor = beautyRenderer?.let { FuVideoFrameInterceptor(it).apply {
|
||||
setFrontCamera(isFrontCamera)
|
||||
setEnabled(beautyEnabled)
|
||||
} }
|
||||
|
||||
@@ -125,14 +125,6 @@ class LivePlayActivity : AppCompatActivity() {
|
||||
}
|
||||
updatePreviewVisibility()
|
||||
logEvent("状态变更: ${formatState(state)}")
|
||||
if (state == SellyPlayerState.Playing && firstVideoFrameElapsedMs == null) {
|
||||
val startMs = playAttemptStartElapsedMs
|
||||
firstVideoFrameElapsedMs = SystemClock.elapsedRealtime()
|
||||
if (startMs != null) {
|
||||
firstVideoFrameCostMs = firstVideoFrameElapsedMs!! - startMs
|
||||
logEvent("首帧视频耗时=${firstVideoFrameCostMs}ms")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,6 +132,11 @@ class LivePlayActivity : AppCompatActivity() {
|
||||
runOnUiThread {
|
||||
hasFirstVideoFrameRendered = true
|
||||
updatePreviewVisibility()
|
||||
if (firstVideoFrameElapsedMs != null) return@runOnUiThread
|
||||
val startMs = playAttemptStartElapsedMs ?: return@runOnUiThread
|
||||
firstVideoFrameElapsedMs = SystemClock.elapsedRealtime()
|
||||
firstVideoFrameCostMs = firstVideoFrameElapsedMs!! - startMs
|
||||
logEvent("首帧视频耗时=${firstVideoFrameCostMs}ms")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -220,8 +220,10 @@ class LivePushActivity : AppCompatActivity() {
|
||||
|
||||
try {
|
||||
val videoConfig = buildVideoConfig(settings)
|
||||
pusherClient.setVideoConfiguration(videoConfig)
|
||||
pusherClient.attachPreview(binding.previewContainer)
|
||||
pusherClient.startRunning(currentFacing, videoConfig, null)
|
||||
applyStreamConfig(settings)
|
||||
} catch (t: Throwable) {
|
||||
Toast.makeText(this, "初始化预览失败: ${t.message}", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user