Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
159bd2a0
Commit
159bd2a0
authored
Mar 13, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webcam ready
parent
2124455a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
ScreenController.kt
.../roompark/presentation/screen/web_cam/ScreenController.kt
+3
-6
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/web_cam/ScreenController.kt
View file @
159bd2a0
...
@@ -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()
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment