Exoplayer server videostream

25 views Asked by At

I have a camera device connected as wifi to the phone which can be streamed by vlc or browser, and im making an app to do that there. This code works with mp3 and mp4, but not the http link of the camera. Am I doing something wrong?

strings.xml media_url_mp3:https://storage.googleapis.com/exoplayer-test-media-0/Jazz_In_Paris.mp3 media_url_mp4:https://storage.googleapis.com/exoplayer-test-media-0/BigBuckBunny_320x180.mp4 camera_stream:http://192.168.4.1:8081/video

PlayerActivity.kt

   private fun initializePlayer(){
        player = SimpleExoPlayer.Builder(this)
            .build()
            .also {
                exoPlayer -> viewBinding.videoView.player = exoPlayer
                val mediaItem = MediaItem.fromUri(getString(R.string.camera_stream))
                exoPlayer.setMediaItem(mediaItem)

                exoPlayer.playWhenReady = playWhenReady
                exoPlayer.seekTo(currentWindow, playbackPosition)
                exoPlayer.prepare()
            }
    }

Maybe the problem is the type, but im confused what should be of the exoplayer options https://developer.android.com/media/media3/exoplayer/dash?hl=pt-br The stream is a 1280x740 video without audio

0

There are 0 answers