David Liu

update readme to use new simple apis

正在显示 1 个修改的文件 包含 5 行增加8 行删除
@@ -38,13 +38,10 @@ class MainActivity : AppCompatActivity(), RoomListener { @@ -38,13 +38,10 @@ class MainActivity : AppCompatActivity(), RoomListener {
38 this 38 this
39 ) 39 )
40 val localParticipant = room.localParticipant 40 val localParticipant = room.localParticipant
41 - val audioTrack = localParticipant.createAudioTrack()  
42 - localParticipant.publishAudioTrack(audioTrack)  
43 - val videoTrack = localParticipant.createVideoTrack()  
44 - localParticipant.publishVideoTrack(videoTrack)  
45 - videoTrack.startCapture() 41 + localParticipant.setMicrophoneEnabled(true)
  42 + localParticipant.setCameraEnabled(true)
46 43
47 - attachVideo(videoTrack, localParticipant) 44 + attachVideo(videoTrack)
48 } 45 }
49 } 46 }
50 47
@@ -55,11 +52,11 @@ class MainActivity : AppCompatActivity(), RoomListener { @@ -55,11 +52,11 @@ class MainActivity : AppCompatActivity(), RoomListener {
55 room: Room 52 room: Room
56 ) { 53 ) {
57 if (track is VideoTrack) { 54 if (track is VideoTrack) {
58 - attachVideo(track, participant) 55 + attachVideo(track)
59 } 56 }
60 } 57 }
61 58
62 - private fun attachVideo(videoTrack: VideoTrack, participant: Participant) { 59 + private fun attachVideo(videoTrack: VideoTrack) {
63 // viewBinding.renderer is a `org.webrtc.SurfaceViewRenderer` in your 60 // viewBinding.renderer is a `org.webrtc.SurfaceViewRenderer` in your
64 // layout 61 // layout
65 videoTrack.addRenderer(viewBinding.renderer) 62 videoTrack.addRenderer(viewBinding.renderer)