@@ -64,7 +64,7 @@ @interface FullscreenMovieDelegate : NSObject
6464 UIControl *m_overlay;
6565}
6666
67- - (id )init ;
67+ - (id )initWithPlayer ;
6868- (void )dealloc ;
6969
7070- (void )begin : (bool )p_add_overlay ;
@@ -80,7 +80,8 @@ - (void)movieWindowTouched: (UIControl*) p_sender;
8080
8181@implementation FullscreenMovieDelegate
8282
83- - (id )init
83+ // AL-2014-09-09: [[ Bug 13354 ]] Replace deprecated MPMoviePlayerContentPreloadDidFinishNotification
84+ - (id )initWithPlayer : (MPMoviePlayerController *)p_player
8485{
8586 self = [super init ];
8687 if (self == nil )
@@ -90,11 +91,11 @@ - (id)init
9091 selector: @selector (movieFinished: )
9192 name: MPMoviePlayerPlaybackDidFinishNotification
9293 object: nil ];
93-
94+
9495 [[NSNotificationCenter defaultCenter ] addObserver: self
9596 selector: @selector (moviePreloadFinished: )
96- name: MPMoviePlayerContentPreloadDidFinishNotification
97- object: nil ];
97+ name: MPMoviePlayerLoadStateDidChangeNotification
98+ object: p_player ];
9899
99100 m_running = true ;
100101 m_overlay = nil ;
@@ -159,7 +160,8 @@ - (void)movieFinished: (NSNotification *) p_notification
159160
160161- (void )moviePreloadFinished : (NSNotification *) p_notification
161162{
162- if ([[p_notification userInfo ] objectForKey: @" error" ] != nil )
163+ // AL-2014-09-09: [[ Bug 13354 ]] Replace deprecated MPMoviePlayerContentPreloadDidFinishNotification
164+ if ([[p_notification object ] loadState ] & MPMovieLoadStateUnknown)
163165 {
164166 m_running = false ;
165167
@@ -240,7 +242,7 @@ static void play_fullscreen_movie_prewait(void *p_context)
240242
241243 configure_playback_range (ctxt -> movie_player);
242244
243- ctxt -> delegate = [[FullscreenMovieDelegate alloc ] init ];
245+ ctxt -> delegate = [[FullscreenMovieDelegate alloc ] initWithPlayer: ctxt -> movie_player ];
244246
245247 // Present the view controller and get the delegate to setup its overlay
246248 // if needed.
0 commit comments