Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
Linhome-Android
Commits
e5915858
Commit
e5915858
authored
Dec 03, 2020
by
Christophe Deschamps
Browse files
Temporarily disable seek on player (mantis 0008305)
parent
b2b3cfbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
app/src/main/java/org/linhome/ui/player/PlayerActivity.kt
app/src/main/java/org/linhome/ui/player/PlayerActivity.kt
+6
-6
No files found.
app/src/main/java/org/linhome/ui/player/PlayerActivity.kt
View file @
e5915858
...
...
@@ -25,18 +25,17 @@ import android.os.Bundle
import
android.os.SystemClock
import
android.view.TextureView
import
android.view.View
import
android.view.View.OnTouchListener
import
androidx.databinding.DataBindingUtil
import
androidx.lifecycle.Observer
import
androidx.lifecycle.ViewModelProvider
import
kotlinx.android.synthetic.main.activity_player.view.*
import
kotlinx.android.synthetic.main.chunk_player_controls.view.*
import
kotlinx.android.synthetic.main.item_history.*
import
org.linhome.GenericActivity
import
org.linhome.LinhomeApplication
import
org.linhome.R
import
org.linhome.databinding.ActivityPlayerBinding
import
org.linhome.linphonecore.extensions.historyEvent
import
org.linphone.core.AudioDevice
import
org.linphone.core.Player
import
org.linphone.core.tools.Log
...
...
@@ -82,7 +81,7 @@ class PlayerActivity : GenericActivity(allowsLandscapeOnSmartPhones = true) {
}
setupPlayerControl
(
binding
.
root
,
playerViewModel
)
if
(
event
.
hasVideo
)
{
setTextureView
(
binding
.
root
.
video
,
player
,
seekTo
,
playing
)
setTextureView
(
binding
.
root
.
video
,
player
,
seekTo
,
playing
)
}
}
}
...
...
@@ -95,8 +94,8 @@ class PlayerActivity : GenericActivity(allowsLandscapeOnSmartPhones = true) {
override
fun
onSaveInstanceState
(
outState
:
Bundle
)
{
super
.
onSaveInstanceState
(
outState
)
outState
.
clear
()
outState
.
putInt
(
"position"
,
playerViewModel
.
position
.
value
!!
)
outState
.
putBoolean
(
"playing"
,
playerViewModel
.
playing
.
value
!!
)
outState
.
putInt
(
"position"
,
playerViewModel
.
position
.
value
!!
)
outState
.
putBoolean
(
"playing"
,
playerViewModel
.
playing
.
value
!!
)
}
private
fun
setupPlayerControl
(
view
:
View
,
model
:
PlayerViewModel
)
{
...
...
@@ -120,10 +119,11 @@ class PlayerActivity : GenericActivity(allowsLandscapeOnSmartPhones = true) {
view
.
timer
.
setOnChronometerTickListener
{
model
.
updatePosition
()
}
view
.
seek
.
setOnTouchListener
({
view
,
motionEvent
->
false
})
}
fun
setTextureView
(
textureView
:
TextureView
,
player
:
Player
,
seekTo
:
Int
,
playing
:
Boolean
)
{
fun
setTextureView
(
textureView
:
TextureView
,
player
:
Player
,
seekTo
:
Int
,
playing
:
Boolean
)
{
Log
.
i
(
"[Player] Is TextureView available? ${textureView.isAvailable}"
)
if
(
textureView
.
isAvailable
)
{
player
.
setWindowId
(
textureView
.
surfaceTexture
)
...
...
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