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
52e38547
Commit
52e38547
authored
Dec 05, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added flag to ignore audio stream input (otherwise playr stuck in infinity buffering status
parent
ee5dbb91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
ScreenController.kt
.../roompark/presentation/screen/web_cam/ScreenController.kt
+11
-4
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/web_cam/ScreenController.kt
View file @
52e38547
...
...
@@ -13,9 +13,12 @@ import com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.google.android.exoplayer2.ExoPlayerFactory
import
com.google.android.exoplayer2.SimpleExoPlayer
import
com.google.android.exoplayer2.ext.rtmp.RtmpDataSourceFactory
import
com.google.android.exoplayer2.extractor.DefaultExtractorsFactory
import
com.google.android.exoplayer2.extractor.ts.DefaultTsPayloadReaderFactory
import
com.google.android.exoplayer2.source.MediaSource
import
com.google.android.exoplayer2.source.ProgressiveMediaSource
import
com.google.android.exoplayer2.source.hls.DefaultHlsDataSourceFactory
import
com.google.android.exoplayer2.source.hls.DefaultHlsExtractorFactory
import
com.google.android.exoplayer2.source.hls.HlsMediaSource
import
com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection
import
com.google.android.exoplayer2.trackselection.DefaultTrackSelector
...
...
@@ -168,12 +171,12 @@ class WebCamScreenController :
val
sourceUrl
=
viewState
.
camList
.
first
{
it
.
index
==
viewState
.
selectedCamIndex
}.
streams
.
first
().
hls
var
rtmpUrl
=
viewState
.
camList
.
first
{
it
.
index
==
viewState
.
selectedCamIndex
}.
streams
.
first
().
rtmp
//
var rtmpUrl = viewState.camList.first{it.index == viewState.selectedCamIndex}.streams
//
.first().rtmp
// rtmpUrl = "rtmp://room-park.ru:1935/cam2-360/stream"
// Timber.d("source url : ${Uri.parse(rtmpUrl)}")
//
val mediaSource = buildMediaSource(Uri.parse(sourceUrl))
val
mediaSource
=
buildRtmps
(
Uri
.
parse
(
rtmpUrl
))
val
mediaSource
=
buildMediaSource
(
Uri
.
parse
(
sourceUrl
))
//
val mediaSource = buildRtmps(Uri.parse(rtmpUrl))
Timber
.
d
(
"source url : ${Uri.parse(sourceUrl)}"
)
Timber
.
d
(
"mediaSource : $mediaSource"
)
player
.
prepare
(
mediaSource
,
true
,
true
)
...
...
@@ -189,7 +192,11 @@ class WebCamScreenController :
private
fun
buildMediaSource
(
uri
:
Uri
):
MediaSource
{
val
source
=
DefaultDataSourceFactory
(
activity
,
"ua"
)
val
dataSourceFactory
=
DefaultHlsDataSourceFactory
(
source
)
//.createDataSource(DATA_TYPE_DRM)
val
extr
=
DefaultHlsExtractorFactory
(
DefaultTsPayloadReaderFactory
.
FLAG_IGNORE_AAC_STREAM
,
true
)
(
DefaultTsPayloadReaderFactory
.
FLAG_ALLOW_NON_IDR_KEYFRAMES
)
return
HlsMediaSource
.
Factory
(
dataSourceFactory
)
.
setExtractorFactory
(
extr
)
.
setAllowChunklessPreparation
(
true
)
.
createMediaSource
(
uri
)
}
...
...
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