Skip to content

Commit 46da131

Browse files
committed
新增切换码流清晰度提示内容
http://tapd.oa.com/20393192/bugtrace/bugs/view?bug_id=1020393192091149999&url_cache_key=d302fcd0dbc98b4daaa9c4714102d392 Change-Id: I9ada9373d0ead6e54eb2b7a60e54674c9b18f11e
1 parent 05beebf commit 46da131

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
1919
import com.alibaba.fastjson.JSON
2020
import com.alibaba.fastjson.JSONArray
2121
import com.tencent.iot.explorer.link.demo.App
22-
import com.tencent.iot.explorer.link.demo.BaseActivity
2322
import com.tencent.iot.explorer.link.demo.R
2423
import com.tencent.iot.explorer.link.demo.VideoBaseActivity
2524
import com.tencent.iot.explorer.link.demo.common.util.CommonUtils
@@ -137,7 +136,6 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface
137136
player = IjkMediaPlayer()
138137

139138
Thread(Runnable {
140-
connectStartTime = System.currentTimeMillis()
141139
var id = "${App.data.accessInfo!!.productId}/${presenter.getDeviceName()}"
142140
var started = XP2P.startServiceWithXp2pInfo(id,
143141
App.data.accessInfo!!.productId, presenter.getDeviceName(), "")
@@ -149,14 +147,14 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface
149147
return@Runnable
150148
}
151149

150+
connectStartTime = System.currentTimeMillis()
152151
var tmpCountDownLatch = CountDownLatch(1)
153152
countDownLatchs.put("${App.data.accessInfo!!.productId}/${presenter.getDeviceName()}", tmpCountDownLatch)
154153
tmpCountDownLatch.await()
155154

156155
urlPrefix = XP2P.delegateHttpFlv("${App.data.accessInfo!!.productId}/${presenter.getDeviceName()}")
157156
if (!TextUtils.isEmpty(urlPrefix)) {
158157
player?.let {
159-
startShowVideoTime = System.currentTimeMillis()
160158
resetPlayer()
161159
keepPlayerplay("${App.data.accessInfo!!.productId}/${presenter.getDeviceName()}")
162160
}
@@ -168,7 +166,7 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface
168166
if (TextUtils.isEmpty(id)) return
169167

170168
// 开启守护线程
171-
Thread(Runnable {
169+
Thread{
172170
var objectLock = Object()
173171
while (true) {
174172
var tmpCountDownLatch = CountDownLatch(1)
@@ -190,6 +188,7 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface
190188
}
191189
Log.d(tag, "id=${id}, try to call startServiceWithXp2pInfo")
192190
}
191+
connectStartTime = System.currentTimeMillis()
193192

194193
Log.d(tag, "id=${id}, call startServiceWithXp2pInfo successed")
195194
countDownLatchs.put(id!!, tmpCountDownLatch)
@@ -200,7 +199,7 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface
200199
urlPrefix = XP2P.delegateHttpFlv(id)
201200
if (!TextUtils.isEmpty(urlPrefix)) resetPlayer()
202201
}
203-
}).start()
202+
}.start()
204203
}
205204

206205
private fun resetPlayer() {
@@ -400,6 +399,8 @@ class VideoPreviewActivity : VideoBaseActivity(), EventView, TextureView.Surface
400399
}
401400

402401
private fun setPlayerUrl(suffix: String) {
402+
showTip = false
403+
startShowVideoTime = System.currentTimeMillis()
403404
player?.let {
404405
val url = urlPrefix + suffix
405406
it.reset()

0 commit comments

Comments
 (0)