B4A Library Play RTSP easily

I can't get this to work.

I click "Start" and nothing happens - no video, no error displayed or in event log.

If I enter the exact same URL into VLC, the video plays fine.

PS. I don't know if this helps but after compiling this example, there is only the permission of "android.permission.FOREGROUND_SERVICE" - there are no permissions requested for network access which I though was strange because this app needs to access the network.
 
Hi:

It's working for me, thanks for sharing¡¡
I will donate to Biswagit as soon as possible¡¡
 
OK, I added "AddPermission("android.permission.INTERNET")" to the manifest.

Now the video plays, but no audio :(
 
Last edited:
If possible, it would be great if this wrapper could support a volume property, so that the user could control the volume.
 
Last edited:
I can't get this to work.

I click "Start" and nothing happens - no video, no error displayed or in event log.

If I enter the exact same URL into VLC, the video plays fine.

PS. I don't know if this helps but after compiling this example, there is only the permission of "android.permission.FOREGROUND_SERVICE" - there are no permissions requested for network access which I though was strange because this app needs to access the network.
What is your link?
Do you set username and password correctly?
 
There is no username or password.

This is a temporary link I will keep active for a day or so:

[deleted]

Using VLC, after a small delay, both video and audio work fine.

But using this sample only the video works - I do not get sound.
 
Last edited:
But using this sample only the video works - I do not get sound.
Tested with VLC on my computer. I get sound at the beginning of the stream for one second, then it's mute despite codec-info in VLC indicating there is an audio stream included. Perhaps something wrong with the stream?
Same thing with Vitamio5 (video OK but no sound)
 
When I run the latest VLC on my android phone with cell connection, the screen starts black for about 8 seconds, then the video and audio start and both keep streaming OK long term (audio or video does not kick out).

When I test the Vitamio5 with cell connection, always stays black and no audio ("vvit5_Prepared" event never happens).
When I test the Vitamio5 with local network connection (encode is on the local network), video appears in a few seconds, but no audio.

When I test with the wrapper in this thread with cell connection, video starts almost immediately, but never any audio.
When I test with the wrapper in this thread with local network (encode is on the local network), video starts almost immediately, but never any audio.
 
Last edited:
When I run the latest VLC on my android phone with cell connection, the screen starts black for about 8 seconds, then the video and audio start and both keep streaming OK long term (audio or video does not kick out).

When I test the Vitamio5 with cell connection, always stays black and no audio ("vvit5_Prepared" event never happens).
When I test the Vitamio5 with local network connection (encode is on the local network), video appears in a few seconds, but no audio.

When I test with the wrapper in this thread with cell connection, video starts almost immediately, but never any audio.
When I test with the wrapper in this thread with local network (encode is on the local network), video starts almost immediately, but never any audio.
Do you have a testing link that has sound?
I want to give link to Biswagit for testing it
 
I re-enabled the link in post #8.

If you use the latest version of VLC for android and enter that URL into VLC, after about 5 seconds the video AND audio will play.

But for some reason, the audio does not work with this wrapper.

Sending this link to Biswagit would be greatly appreciated.
 
I re-enabled the link in post #8.

If you use the latest version of VLC for android and enter that URL into VLC, after about 5 seconds the video AND audio will play.

But for some reason, the audio does not work with this wrapper.

Sending this link to Biswagit would be greatly appreciated.
Thank you, I hope Biswagit can solve it
 
java.lang.NoClassDefFoundError: com/alexvas/rtsp/widget/RtspSurfaceView$$Lambda$1
at com.alexvas.rtsp.widget.RtspSurfaceView.onRtspClientConnected(RtspSurfaceView.kt:253)
at com.alexvas.rtsp.widget.RtspSurfaceView.access$onRtspClientConnected(RtspSurfaceView.kt:22)
at com.alexvas.rtsp.widget.RtspSurfaceView$proxyClientListener$1.onRtspConnected(RtspSurfaceView.kt:98)
at com.alexvas.rtsp.RtspClient.execute(RtspClient.java:467)
at com.alexvas.rtsp.widget.RtspSurfaceView$RtspThread.run(RtspSurfaceView.kt:229)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.alexvas.rtsp.widget.RtspSurfaceView$$Lambda$1" on path: DexPathList[[zip file "/data/app/b4a.example-1.apk"],nativeLibraryDirectories=[/data/app-lib/b4a.example-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
... 5 more
** Activity (main) Pause, UserClosed = true **
 
java.lang.NoClassDefFoundError: com/alexvas/rtsp/widget/RtspSurfaceView$$Lambda$1
at com.alexvas.rtsp.widget.RtspSurfaceView.onRtspClientConnected(RtspSurfaceView.kt:253)
at com.alexvas.rtsp.widget.RtspSurfaceView.access$onRtspClientConnected(RtspSurfaceView.kt:22)
at com.alexvas.rtsp.widget.RtspSurfaceView$proxyClientListener$1.onRtspConnected(RtspSurfaceView.kt:98)
at com.alexvas.rtsp.RtspClient.execute(RtspClient.java:467)
at com.alexvas.rtsp.widget.RtspSurfaceView$RtspThread.run(RtspSurfaceView.kt:229)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.alexvas.rtsp.widget.RtspSurfaceView$$Lambda$1" on path: DexPathList[[zip file "/data/app/b4a.example-1.apk"],nativeLibraryDirectories=[/data/app-lib/b4a.example-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
... 5 more
** Activity (main) Pause, UserClosed = true **

same error here
 
Why this error?
Code: Copy
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension;
    at com.alexvas.rtsp.widget.RtspSurfaceView$RtspThread.run(RtspSurfaceView.kt:233)
Caused by: java.lang.ClassNotFoundException: com.google.devtools.build.android.desugar.runtime.ThrowableExtension
    ... 1 more
Same error.
Solution: select ExoPlayer in libraries.
 
ExoPlayer in b4a not support rtsp link.
No. I didn't say ExoPlayer supports RTSP. What I said is to select ExoPlayer Library in the IDE to solve the following error
B4X: Copy
java.lang.ClassNotFoundException: com.google.devtools.build.android.desugar.runtime.ThrowableExtension
while using RTSP Library.
In other words, RTSP Library requires ExoPlayer Library to be selected.
 
Any solution for B4J also ?
 
Hi, I'm also facing similar error messages and can't get it to work.
Code: Copy
--------- beginning of crash
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension;
    at com.alexvas.rtsp.RtspClient.execute(RtspClient.java:524)
    at com.alexvas.rtsp.widget.RtspSurfaceView$RtspThread.run(RtspSurfaceView.kt:229)
Caused by: java.lang.ClassNotFoundException: com.google.devtools.build.android.desugar.runtime.ThrowableExtension
    ... 2 more

ExoPlayer 1.70 ("addoexo") library is selected.
 
Back
Top