Skip to content

Commit

Permalink
【讯美项目支持】支持P2P本地录像下载
Browse files Browse the repository at this point in the history
移除调试日志,调整Dialog

http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192870647767?

Change-Id: Ibd3b5820e131c7d17c265f64af79be348d2e5766
  • Loading branch information
archurtan committed Mar 2, 2022
1 parent f2232a2 commit 2cb39a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sdk/video-link-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies {
// api('com.tencent.iot.thirdparty.android:xp2p-sdk:latest.integration') {
// changing = true
// }
api 'com.tencent.iot.thirdparty.android:xp2p-sdk:2.4.23-SNAPSHOT'
api 'com.tencent.iot.thirdparty.android:xp2p-sdk:2.4.23'
api 'com.tencent.iot.thirdparty.android:media-server:1.0.0'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ class VideoLocalPlaybackFragment : VideoPlaybackBaseFragment(), TextureView.Surf
private var onDownloadClickedListener =
object : LocalPlaybackListAdapter.OnDownloadClickedListener {
override fun onItemDownloadClicked(pos: Int) {
Toast.makeText(context, "${pos} download is clicked.", Toast.LENGTH_SHORT).show()
if (!isDownloading) {
val offset = initDownload(playbacks[pos])
if (offset >= 0) {
Expand All @@ -399,6 +398,7 @@ class VideoLocalPlaybackFragment : VideoPlaybackBaseFragment(), TextureView.Surf
)
isDownloading = true
toastDialog = ToastDialog(context, ToastDialog.Type.SUCCESS, getString(R.string.downloading), 600000)
toastDialog.setCancelable(false)
toastDialog.show()
}
} else {
Expand All @@ -409,7 +409,6 @@ class VideoLocalPlaybackFragment : VideoPlaybackBaseFragment(), TextureView.Surf

private var onItemClickedListener = object : LocalPlaybackListAdapter.OnItemClickedListener {
override fun onItemClicked(pos: Int) {
Toast.makeText(context, "${pos} item is clicked.", Toast.LENGTH_SHORT).show()
currentPlayerState = true
playVideo(playbacks[pos].start_time, playbacks[pos].end_time, 0)
}
Expand Down Expand Up @@ -717,6 +716,7 @@ class VideoLocalPlaybackFragment : VideoPlaybackBaseFragment(), TextureView.Surf
videoFile.length() // 断点续传的偏移量
}
}
Toast.makeText(context, "path: ${videoName}", Toast.LENGTH_LONG).show()
out = FileOutputStream(videoFile, true)
return offset
}
Expand Down Expand Up @@ -781,7 +781,7 @@ class VideoLocalPlaybackFragment : VideoPlaybackBaseFragment(), TextureView.Surf
out?.flush()
toastDialog.dismiss()
isDownloading = false
Toast.makeText(context, getString(R.string.download_complete), Toast.LENGTH_SHORT).show()
ToastDialog(context, ToastDialog.Type.SUCCESS, getString(R.string.download_complete), 2000).show()
}
}
}
Expand Down

0 comments on commit 2cb39a4

Please sign in to comment.