Commit f9dad878 authored by Felix Paul Kühne's avatar Felix Paul Kühne

VLCMediaPlayer: don't pause playback if the iOS app is going to the...

VLCMediaPlayer: don't pause playback if the iOS app is going to the background, since this behavior may be different per client application
parent 4b2626de
......@@ -96,7 +96,6 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
float position; //< The position of the media being played
id drawable; //< The drawable associated to this media player
VLCAudio *audio;
BOOL shouldResumePlaying; //< resume playing on iOS
}
#if !TARGET_OS_IPHONE
......
......@@ -50,8 +50,6 @@ Modified behavior:
MobileVLCKit features:
- added support for Opus
- slimmed binary by removing dysfunctional or irrelevant modules
- playback is paused if client app resigns active state
- playback resumes if client app is being active again
- idle state and screen sleep is prevented during playback
Removed APIs:
......
......@@ -199,9 +199,6 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
[self unregisterObservers];
[[VLCEventManager sharedManager] cancelCallToObject:self];
#if TARGET_OS_IPHONE
[[NSNotificationCenter defaultCenter] removeObserver:self];
#endif
// Always get rid of the delegate first so we can stop sending messages to it
// TODO: Should we tell the delegate that we're shutting down?
......@@ -952,15 +949,6 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
instance = libvlc_media_player_new([VLCLibrary sharedInstance]);
[self registerObservers];
#if TARGET_OS_IPHONE
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self selector:@selector(applicationWillResignActive:)
name:UIApplicationWillResignActiveNotification object:nil];
[center addObserver:self selector:@selector(applicationDidBecomeActive:)
name:UIApplicationDidBecomeActiveNotification object:nil];
[center addObserver:self selector:@selector(applicationDidEnterBackground:)
name:UIApplicationDidEnterBackgroundNotification object:nil];
#endif
[self setDrawable:aDrawable];
}
......@@ -999,27 +987,6 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
libvlc_event_detach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self);
}
#if TARGET_OS_IPHONE
- (void)applicationWillResignActive:(NSNotification *)notification
{
shouldResumePlaying = YES;
[self pause];
}
- (void)applicationDidEnterBackground:(NSNotification *)notification
{
shouldResumePlaying = NO;
}
- (void)applicationDidBecomeActive:(NSNotification *)notification
{
if (shouldResumePlaying) {
shouldResumePlaying = NO;
[self play];
}
}
#endif
- (void)mediaPlayerTimeChanged:(NSNumber *)newTime
{
[self willChangeValueForKey:@"time"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment