Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
0ec56c4b
Commit
0ec56c4b
authored
Jun 09, 2015
by
Felix Paul Kühne
Browse files
playback: move sleep timer to vpc and adapt to logic changes (closes #14829)
(cherry picked from commit
d473feca
)
parent
7140fb75
Changes
3
Hide whitespace changes
Inline
Side-by-side
Sources/VLCMovieViewController.m
View file @
0ec56c4b
...
...
@@ -59,7 +59,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
UIActionSheet
*
_audiotrackActionSheet
;
NSTimer
*
_idleTimer
;
NSTimer
*
_sleepTimer
;
BOOL
_viewAppeared
;
BOOL
_displayRemainingTime
;
...
...
@@ -1008,11 +1007,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
-
(
IBAction
)
sleepTimerAction
:(
id
)
sender
{
if
(
_sleepTimer
)
{
[
_sleepTimer
invalidate
];
_sleepTimer
=
nil
;
}
_sleepTimer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
_sleepTimeDatePicker
.
countDownDuration
target
:
self
selector
:
@selector
(
closePlayback
:
)
userInfo
:
nil
repeats
:
NO
];
VLCPlaybackController
*
vpc
=
[
VLCPlaybackController
sharedInstance
];
[
vpc
scheduleSleepTimerWithInterval
:
_sleepTimeDatePicker
.
countDownDuration
];
}
-
(
void
)
moreActions
:(
id
)
sender
...
...
Sources/VLCPlaybackController.h
View file @
0ec56c4b
...
...
@@ -89,6 +89,6 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
-
(
void
)
recoverPlaybackState
;
-
(
void
)
setNeedsMetadataUpdate
;
-
(
void
)
scheduleSleepTimerWithInterval
:(
NSTimeInterval
)
timeInterval
;
@end
Sources/VLCPlaybackController.m
View file @
0ec56c4b
...
...
@@ -37,6 +37,7 @@ NSString *const VLCPlaybackControllerPlaybackDidFail = @"VLCPlaybackControllerPl
BOOL
_playerIsSetup
;
BOOL
_playbackFailed
;
BOOL
_shouldResumePlaying
;
NSTimer
*
_sleepTimer
;
NSArray
*
_aspectRatios
;
NSUInteger
_currentAspectRatioMask
;
...
...
@@ -931,6 +932,15 @@ setstuff:
forPlaybackController:
self
];
}
-
(
void
)
scheduleSleepTimerWithInterval
:(
NSTimeInterval
)
timeInterval
{
if
(
_sleepTimer
)
{
[
_sleepTimer
invalidate
];
_sleepTimer
=
nil
;
}
_sleepTimer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
timeInterval
target
:
self
selector
:
@selector
(
stopPlayback
)
userInfo
:
nil
repeats
:
NO
];
}
#pragma mark - remote events
static
inline
NSArray
*
RemoteCommandCenterCommandsToHandle
(
MPRemoteCommandCenter
*
cc
)
...
...
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