Back to All Guides
codeAugust 14, 20266 min readRTSPLink Dev Team

Android Java & Kotlin RTSP Video Player with ExoPlayer

Stream live RTSP surveillance feeds natively in Android mobile applications using Media3 ExoPlayer RTSP extension.

#Android#Kotlin#ExoPlayer#Mobile App#Java
Live Stream Workbench

Need a live RTSP stream link right now to test this setup in VLC or OpenCV?

Test Live Stream

#1Kotlin ExoPlayer RTSP Initialization

Configure RtspMediaSource in Android Media3 ExoPlayer:

Kotlin ExoPlayer RTSP Source
val player = ExoPlayer.Builder(context).build()
val mediaItem = MediaItem.fromUri("rtsp://rtsplink.com/live/test?token=demo")
val mediaSource = RtspMediaSource.Factory()
    .setForceUseRtpTcp(true)
    .createMediaSource(mediaItem)

player.setMediaSource(mediaSource)
player.prepare()
player.play()

Ready to test your live RTSP video stream?

Generate free authenticated RTSP links with unlimited bandwidth and inspect frame timestamps in seconds.

Generate Free RTSP Link

Related Tutorials & Setup Guides

View all 100+ guides