3

I want to play an animation(Gif) or a movie instead of Default.png. Is that possible? I tried what is described in this blog :http://www.cuppadev.co.uk/iphone/playing-animated-gifs-on-the-iphone/ but I don't know how to play a Gif animation instead of Default.png

Mickey Shine
  • 12,187
  • 25
  • 96
  • 148

3 Answers3

4

If you're asking about a sanctioned App Store app, then no, you can't use anything but a static Default.png.

If you're writing an app for jailbroken phone, this may be possible (but I don't know).

Ben Zotto
  • 70,108
  • 23
  • 141
  • 204
  • I am an iPhone developer and I want to play a Gif animation when my app starts. That's all I want to do – Mickey Shine Mar 19 '10 at 04:36
  • You could set the Default.png file to the first frame of your animation, and then kick off an animation on top of this once the app is ready to go. – csano May 12 '11 at 17:12
1

The Following code should come in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

NSBundle *bundle = [NSBundle mainBundle];
if(bundle != nil)
{
    NSString *videoPath = [bundle pathForResource:@"trail_video" ofType:@"mp4"];
    if (moviePath)
    {
        videoURL = [NSURL fileURLWithPath:moviePath];
    }
}

theMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];

theMovie.moviePlayer.controlStyle = MPMovieControlStyleNone;
theMovie.moviePlayer.scalingMode = MPMovieScalingModeFill;

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(moviePlayerDidFinish:)
                                             name:MPMoviePlayerPlaybackDidFinishNotification
                                           object:theMovie.moviePlayer];

[theMovie.moviePlayer setFullscreen:YES animated:NO];
[theMovie.moviePlayer prepareToPlay];
[theMovie.moviePlayer play];
window.rootViewController = theMovie;
[self.window.rootViewController.view bringSubviewToFront:mMoviePlayer.moviePlayer.view];

In the moviePlayerDidFinish method load the screen which you desire to load.

Manju
  • 4,133
  • 2
  • 19
  • 12
0

Unfortunately, it's impossible to do it on the latest iPhone OS. A trick using symbolic link is currently blocked by OS.

KatokichiSoft
  • 932
  • 5
  • 8