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
d0f9f0cd
Commit
d0f9f0cd
authored
May 15, 2013
by
Gleb Pinigin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement handling play/pause remote events
parent
b61096d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
AspenProject/VLCMovieViewController.m
AspenProject/VLCMovieViewController.m
+41
-0
No files found.
AspenProject/VLCMovieViewController.m
View file @
d0f9f0cd
...
...
@@ -119,6 +119,47 @@
return
self
;
}
#pragma mark - remote events
-
(
void
)
viewDidAppear
:(
BOOL
)
animated
{
[
super
viewDidAppear
:
animated
];
[[
UIApplication
sharedApplication
]
beginReceivingRemoteControlEvents
];
[
self
becomeFirstResponder
];
}
-
(
void
)
viewDidDisappear
:(
BOOL
)
animated
{
[
super
viewDidDisappear
:
animated
];
[[
UIApplication
sharedApplication
]
endReceivingRemoteControlEvents
];
[
self
resignFirstResponder
];
}
-
(
BOOL
)
canBecomeFirstResponder
{
return
YES
;
}
-
(
void
)
remoteControlReceivedWithEvent
:(
UIEvent
*
)
event
{
switch
(
event
.
subtype
)
{
case
UIEventSubtypeRemoteControlPlay
:
[
_mediaPlayer
play
];
break
;
case
UIEventSubtypeRemoteControlPause
:
[
_mediaPlayer
pause
];
break
;
case
UIEventSubtypeRemoteControlTogglePlayPause
:
[
self
play
:
nil
];
break
;
default:
break
;
}
}
#pragma mark - controls visibility
-
(
BOOL
)
gestureRecognizer
:(
UIGestureRecognizer
*
)
gestureRecognizer
shouldReceiveTouch
:(
UITouch
*
)
touch
...
...
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