Skip to content

Commit a8e1811

Browse files
committed
释放资源
1 parent d7d2d32 commit a8e1811

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

sdkdemo/src/main/java/com/tencent/iot/explorer/link/demo/video/playback/cloudPlayback/VideoCloudPlaybackFragment.kt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -448,19 +448,15 @@ class VideoCloudPlaybackFragment: VideoPlaybackBaseFragment<FragmentVideoCloudPl
448448

449449
private var onInfoListener = object : IMediaPlayer.OnInfoListener {
450450
override fun onInfo(mp: IMediaPlayer?, what: Int, extra: Int): Boolean {
451-
with(binding) {
452-
mp?.let {
453-
if (it.isPlaying) {
454-
ivStart.setImageResource(R.mipmap.stop)
455-
pauseTipLayout.visibility = View.GONE
456-
return true
457-
}
451+
mp?.let {
452+
if (it.isPlaying) {
453+
binding.ivStart.setImageResource(R.mipmap.stop)
454+
binding.pauseTipLayout.visibility = View.GONE
455+
return true
458456
}
459-
460-
ivStart.setImageResource(R.mipmap.start)
461-
pauseTipLayout.visibility = View.VISIBLE
462457
}
463-
458+
binding.ivStart.setImageResource(R.mipmap.start)
459+
binding.pauseTipLayout.visibility = View.VISIBLE
464460
return true
465461
}
466462

@@ -481,6 +477,8 @@ class VideoCloudPlaybackFragment: VideoPlaybackBaseFragment<FragmentVideoCloudPl
481477

482478
override fun onDestroy() {
483479
super.onDestroy()
480+
player.stop()
481+
player.release()
484482
cancel()
485483
}
486484

0 commit comments

Comments
 (0)