Skip to content

Commit fe22e4a

Browse files
sevenhheSundoggyNew
authored andcommitted
偶现显示时间不准确问题
https://docs.qq.com/doc/DQ2hDUXZUdHNhc3hv Change-Id: I540f1e794a656af7dd96bb7c1b8cdae512fa05f0
1 parent fad92d9 commit fe22e4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sdkdemo/src/main/java/com/tencent/iot/explorer/link/demo/video/preview/VideoPreviewActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface
497497
override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture?, width: Int, height: Int) {}
498498
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture?): Boolean { return false }
499499
override fun onSurfaceTextureUpdated(surface: SurfaceTexture?) {
500-
if (!showTip) {
500+
if (!showTip && startShowVideoTime > 0) {
501501
showVideoTime = System.currentTimeMillis() - startShowVideoTime
502502
var content = getString(R.string.time_2_show, connectTime.toString(), showVideoTime.toString())
503503
TipToastDialog(this, content, 10000).show()
@@ -512,6 +512,7 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface
512512
override fun xp2pEventNotify(id: String?, msg: String?, event: Int) {
513513
Log.e(tag, "id=${id}, event=${event}")
514514
if (event == 1003) {
515+
startShowVideoTime = 0L
515516
keepPlayThreadLock?.let {
516517
synchronized(it) {
517518
it.notify()

0 commit comments

Comments
 (0)