Skip to content

Commit 918456f

Browse files
committed
拉取多设备实现
1 parent 4e11f6a commit 918456f

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

sdkdemo/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
android:name=".video.preview.VideoTestActivity"
6060
android:configChanges="orientation|keyboardHidden|screenSize" />
6161
<activity android:name=".video.VideoTestInputActivity" />
62+
<activity android:name=".video.MultiVideoTestInputActivity" />
63+
<activity android:name=".video.preview.MultiVideoTestActivity" />
6264
<!-- <activity android:name=".video.preview.WlanVideoPreviewActivity"-->
6365
<!-- android:configChanges="orientation|keyboardHidden|screenSize"/>-->
6466
<activity android:name=".video.VideoMainActivity" />

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.tencent.iot.explorer.link.demo.video
22

3-
import com.tencent.iot.explorer.link.demo.R
3+
import android.app.AlertDialog
44
import com.tencent.iot.explorer.link.demo.VideoBaseActivity
55
import com.tencent.iot.explorer.link.demo.databinding.ActivityVideoOptionsBinding
66

@@ -13,8 +13,21 @@ class VideoOptionsActivity : VideoBaseActivity<ActivityVideoOptionsBinding>() {
1313
with(binding) {
1414
btnVideo.setOnClickListener { jumpActivity(VideoInputAuthorizeActivity::class.java) }
1515
btnVideoWlan.setOnClickListener { jumpActivity(VideoWlanDetectActivity::class.java) }
16-
btnVideoLink.setOnClickListener { jumpActivity(VideoTestInputActivity::class.java) }
16+
btnVideoLink.setOnClickListener { showConnectionTypeDialog() }
1717
}
1818
}
1919

20+
private fun showConnectionTypeDialog() {
21+
val options = arrayOf("单设备直连", "多设备直连")
22+
AlertDialog.Builder(this)
23+
.setTitle("选择连接方式")
24+
.setItems(options) { _, which ->
25+
when (which) {
26+
0 -> jumpActivity(VideoTestInputActivity::class.java)
27+
1 -> jumpActivity(MultiVideoTestInputActivity::class.java)
28+
}
29+
}
30+
.setNegativeButton("取消", null)
31+
.show()
32+
}
2033
}

sdkdemo/src/main/res/values/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,5 +211,6 @@
211211
<string name="hint_app_key">请输入App Key</string>
212212
<string name="app_secret">App Secret *</string>
213213
<string name="hint_app_secret">请输入App Secret</string>
214-
214+
<string name="multi_device_connection">多设备直连</string>
215+
<string name="multi_device_test">多设备测试</string>
215216
</resources>

0 commit comments

Comments
 (0)