This commit is contained in:
li 2024-05-14 10:37:26 +08:00
parent cc465f03f8
commit 469a9af166
4 changed files with 21 additions and 4 deletions

View File

@ -30,6 +30,7 @@
android:theme="@style/Theme.AndroidWebRTC"
tools:overrideLibrary="com.zlm.rtc"
android:usesCleartextTraffic="true"
android:hardwareAccelerated="true"
android:name=".App"
tools:targetApi="31">
<activity

View File

@ -17,8 +17,14 @@ class PlayerDemoActivity:AppCompatActivity() {
Handler().postDelayed({
ZLMRTCPlayer.shareInstance().play("live","test")
ZLMRTCPlayer.shareInstance().play("live","li")
},1000)
}
override fun onDestroy() {
super.onDestroy()
ZLMRTCPlayer.shareInstance().destroy()
}
}

View File

@ -34,6 +34,10 @@ abstract class ZLMRTCPlayer {
public abstract fun pause()
public abstract fun destroy()
public abstract fun resume()
public abstract fun capture(listener: (bitmap: Bitmap) -> Unit)

View File

@ -39,11 +39,11 @@ class ZLMRTCPlayerImpl : ZLMRTCPlayer(), PeerConnectionClient.PeerConnectionEven
false,
1280,
720,
15,
0,
0,
"VP8",
"H264",
true,
true,
false,
0,
"OPUS",
false,
@ -136,6 +136,12 @@ class ZLMRTCPlayerImpl : ZLMRTCPlayer(), PeerConnectionClient.PeerConnectionEven
}
override fun destroy() {
peerConnectionClient?.close()
}
override fun resume() {
}