Commit 159bd2a0 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

webcam ready

parent 2124455a
...@@ -25,7 +25,6 @@ import com.google.android.exoplayer2.trackselection.DefaultTrackSelector ...@@ -25,7 +25,6 @@ import com.google.android.exoplayer2.trackselection.DefaultTrackSelector
import com.google.android.exoplayer2.ui.PlayerView import com.google.android.exoplayer2.ui.PlayerView
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory
import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
...@@ -167,19 +166,17 @@ class WebCamScreenController : ...@@ -167,19 +166,17 @@ class WebCamScreenController :
playerView.player = player playerView.player = player
val sourceUrl = viewState.camList.first{it.index == viewState.selectedCamIndex}.streams val sourceUrl = viewState.camList.first{it.index == viewState.selectedCamIndex}
.first().hls .streams
.last().hls
// var rtmpUrl = viewState.camList.first{it.index == viewState.selectedCamIndex}.streams // var rtmpUrl = viewState.camList.first{it.index == viewState.selectedCamIndex}.streams
// .first().rtmp // .first().rtmp
// rtmpUrl = "rtmp://room-park.ru:1935/cam2-360/stream" // rtmpUrl = "rtmp://room-park.ru:1935/cam2-360/stream"
// Timber.d("source url : ${Uri.parse(rtmpUrl)}") // Timber.d("source url : ${Uri.parse(rtmpUrl)}")
val mediaSource = buildMediaSource(Uri.parse(sourceUrl)) val mediaSource = buildMediaSource(Uri.parse(sourceUrl))
// val mediaSource = buildRtmps(Uri.parse(rtmpUrl)) // val mediaSource = buildRtmps(Uri.parse(rtmpUrl))
Timber.d("source url : ${Uri.parse(sourceUrl)}")
Timber.d("mediaSource : $mediaSource")
player.prepare(mediaSource,true,true) player.prepare(mediaSource,true,true)
player.playWhenReady = true player.playWhenReady = true
Timber.d(" after all: ${player.playbackState}")
// player.seekToDefaultPosition() // player.seekToDefaultPosition()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment