Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Geoffrey Métais
VLC-Android
Commits
e058d8af
Commit
e058d8af
authored
May 07, 2018
by
Geoffrey Métais
Browse files
Rename PlayerController.getTime to fix shadowing
parent
760074d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
vlc-android/src/org/videolan/vlc/PlaybackService.kt
View file @
e058d8af
...
...
@@ -320,7 +320,7 @@ class PlaybackService : MediaBrowserServiceCompat() {
var
time
:
Long
@MainThread
get
()
=
playlistManager
.
player
.
getTime
()
get
()
=
playlistManager
.
player
.
get
Current
Time
()
@MainThread
set
(
time
)
=
playlistManager
.
player
.
setTime
(
time
)
...
...
vlc-android/src/org/videolan/vlc/media/PlayerController.kt
View file @
e058d8af
...
...
@@ -211,7 +211,7 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener {
switchToVideo
=
false
}
fun
getTime
()
=
currentTime
.
value
?:
0L
fun
get
Current
Time
()
=
currentTime
.
value
?:
0L
fun
setRate
(
rate
:
Float
,
save
:
Boolean
)
{
mediaplayer
.
rate
=
rate
...
...
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
View file @
e058d8af
...
...
@@ -207,7 +207,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
@MainThread
fun
previous
(
force
:
Boolean
)
{
if
(
hasPrevious
()
&&
currentIndex
>
0
&&
(
force
||
!
player
.
seekable
||
player
.
getTime
()
<
PREVIOUS_LIMIT_DELAY
))
{
(
force
||
!
player
.
seekable
||
player
.
get
Current
Time
()
<
PREVIOUS_LIMIT_DELAY
))
{
val
size
=
mediaList
.
size
()
currentIndex
=
prevIndex
if
(
previous
.
size
>
0
)
previous
.
pop
()
...
...
@@ -389,7 +389,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
val
canSwitchToVideo
=
player
.
canSwitchToVideo
()
if
(
media
.
type
==
MediaWrapper
.
TYPE_VIDEO
||
canSwitchToVideo
||
media
.
isPodcast
)
{
//Save progress
val
time
=
player
.
getTime
()
val
time
=
player
.
get
Current
Time
()
val
length
=
player
.
length
var
progress
=
time
/
length
.
toFloat
()
if
(
progress
>
0.95f
||
length
-
time
<
10000
)
{
...
...
@@ -577,7 +577,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
editor
.
putBoolean
(
if
(
audio
)
"audio_shuffling"
else
"media_shuffling"
,
shuffling
)
editor
.
putInt
(
if
(
audio
)
"audio_repeating"
else
"media_repeating"
,
repeating
)
editor
.
putInt
(
if
(
audio
)
"position_in_audio_list"
else
"position_in_media_list"
,
if
(
reset
)
0
else
currentIndex
)
editor
.
putLong
(
if
(
audio
)
"position_in_song"
else
"position_in_media"
,
if
(
reset
)
0L
else
player
.
getTime
())
editor
.
putLong
(
if
(
audio
)
"position_in_song"
else
"position_in_media"
,
if
(
reset
)
0L
else
player
.
get
Current
Time
())
if
(!
audio
)
{
editor
.
putBoolean
(
PreferencesActivity
.
VIDEO_PAUSED
,
!
player
.
isPlaying
())
editor
.
putFloat
(
PreferencesActivity
.
VIDEO_SPEED
,
player
.
getRate
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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