Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-iOS
Commits
a4bc6fc1
Commit
a4bc6fc1
authored
May 12, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide UI elements after a timeout of 2s (matching the Android UI) (close #8604)
parent
32ad7051
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
AspenProject/VLCMovieViewController.h
AspenProject/VLCMovieViewController.h
+2
-0
AspenProject/VLCMovieViewController.m
AspenProject/VLCMovieViewController.m
+31
-0
No files found.
AspenProject/VLCMovieViewController.h
View file @
a4bc6fc1
...
...
@@ -17,6 +17,8 @@
UIActionSheet
*
_subtitleActionSheet
;
UIActionSheet
*
_audiotrackActionSheet
;
NSTimer
*
_idleTimer
;
}
@property
(
nonatomic
,
strong
)
IBOutlet
UIView
*
movieView
;
...
...
AspenProject/VLCMovieViewController.m
View file @
a4bc6fc1
...
...
@@ -60,6 +60,8 @@
UITapGestureRecognizer
*
recognizer
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
toogleControlsVisible
)];
recognizer
.
delegate
=
self
;
[
self
.
view
addGestureRecognizer
:
recognizer
];
[
self
resetIdleTimer
];
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
...
...
@@ -147,6 +149,33 @@
[[
UIApplication
sharedApplication
]
setStatusBarHidden
:
_controlsHidden
withAnimation
:
UIStatusBarAnimationFade
];
}
-
(
void
)
resetIdleTimer
{
if
(
!
_idleTimer
)
_idleTimer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
2
.
target:
self
selector:
@selector
(
idleTimerExceeded
)
userInfo:
nil
repeats:
NO
];
else
{
if
(
fabs
([
_idleTimer
.
fireDate
timeIntervalSinceNow
])
<
2
.)
[
_idleTimer
setFireDate
:[
NSDate
dateWithTimeIntervalSinceNow
:
2
.]];
}
}
-
(
void
)
idleTimerExceeded
{
_idleTimer
=
nil
;
if
(
!
_controlsHidden
)
[
self
toogleControlsVisible
];
}
-
(
UIResponder
*
)
nextResponder
{
[
self
resetIdleTimer
];
return
[
super
nextResponder
];
}
#pragma mark - controls
-
(
IBAction
)
closePlayback
:(
id
)
sender
...
...
@@ -157,6 +186,7 @@
-
(
IBAction
)
positionSliderAction
:(
UISlider
*
)
sender
{
_mediaPlayer
.
position
=
sender
.
value
;
[
self
resetIdleTimer
];
}
-
(
void
)
mediaPlayerTimeChanged
:(
NSNotification
*
)
aNotification
{
...
...
@@ -269,6 +299,7 @@
_mediaPlayer
.
gamma
=
self
.
gammaSlider
.
value
=
1
.;
}
else
APLog
(
@"unknown sender for videoFilterSliderAction"
);
[
self
resetIdleTimer
];
}
#pragma mark - app multi tasking
...
...
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