What tools and/or libraries should I use to make an animated book - iphone

I want to make a book rather like The Pedlar Lady for iPad. Each page has some rich text, and then an animation with sound effects that runs automatically after the user flips to a new page.
I have some idea how I could do that programmatically - Cocos2D is looking pretty useful - but what I don't know is how I could work with my artist. What tools could he use, and what would he deliver so that I can just slot each page's animation in with minimal effort.

Your artist can deliver you assets in the form of pngs, mp3s, and movies that have already been scaled to the target device. You can build the book mostly with Interface Builder. Use AVPlayer to play animations and audio on command. Alternatively (and with more memory use) you can animate images with UIImageView. If you need to move assets around the screen, you can use timers and change the origin of each asset's view.
Edit:
MPMoviePlayer is a simple option. The view can be added more directly, but I have found this to be convenient for layout; After configuring a view in IB:
moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:asset.path]];
moviePlayer.moviePlayer.controlStyle = MPMovieControlStyleNone;
[moviePlayerView addSubview:moviePlayer.view];
moviePlayer.view.frame = moviePlayerView.bounds;

Now that Apple is allowing Adobe's Flash -> App maker, you might want to look at that.

Related

How to play 360º video in iPhone SDK

Before downvote please read the question, I also see other question but doesn't find useful.
I have a requirement in my current app, where i needed to play 360º video (Like Panorama). one app on app store doing same Name "GoPano"
http://itunes.apple.com/ke/app/gopano/id459463884?mt=8
I created a framework over the last 2.5 years, which plays back 360° panoramic video playback on iOS, similar to your requirements.
It is compatible with versions 4.3 up to 6.x at this point.
You can download it at www.panframe.com and try if this is what you are looking for.
The framework supplies a UIView that you can easily add as a child and an asset class which you can connect to the view and which will take care of playing spherical panoramic content.
You can look at the interface I used.
You can use it like this dynamically for example in your UIViewController at runtime:
// initialize an PFView
PFView pfView = [PFObjectFactory viewWithFrame:[self.view bounds]];
pfView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
// set the appropriate navigation mode PFView
[pfView setNavigationMode:PF_NAVIGATION_MOTION];
// add the view to the current stack of views
[self.view addSubview:pfView];
[self.view sendSubviewToBack:pfView];
And when you want to play an 360 video asset (from a file URL) you implement the following:
PFView pfAsset = [PFObjectFactory assetFromUrl:[NSURL fileURLWithPath:filePath] observer:(PFAssetObserver*)self];
if ([pfAsset getStatus] != PF_ASSET_ERROR)
{
[pfView displayAsset:pfAsset];
[pfAsset play];
}
Update:
In case some one wants to use it in cordova apps, you can find plugin here
I found these repos useful when creating my own video 360° player:
https://github.com/hanton/HTY360Player
https://github.com/Aralekk/simple360player_iOS
https://github.com/nomtek/spherical_video_player_ios
The last one is mine, and here is it's description.
Google recently released the CardboardSDK for IOS, which supports 360 video playing.
https://developers.google.com/cardboard/ios/
I found that it is embeded player of GoPano. what they done is play video from Java script and with flex.

Creating a view overlay over MPMoviePlayerViewController

I am developing an app that plays internet radio. Owing to my lack of skill, i have only used the stock MPMoviePlayerController.
This is so far been able to play a few m3u streams (like the 'feeling floyd' station)
However, i was wondering if there was any way to have this MPMoviePlayerViewController to show me extra information.. like the song that is playing (which information i was able to extract form teh metadata.)
I can get this information all right, but how do i put it on the screen?
Can I make an overlay or something? (the centre of the MPMovieplayer is taken up by the quicktime background... it would be great if i could use an overlay on this space to show current music information or whatever.)
Is this overlay thing possible? if not, is there any other way?
Thank you very much!
V
If you want your own custom view over the player you can add it as a subview to the player's view as [player.view addSubview:yourView];
Get the moviePlayer property of MPMoviePlayerViewController. I think you should be able to to do this [moviePlayer.view addSubview:myView].

iPad SDK: Embedded YouTube movie plays fullscreen version behind UIWebView

I have a UIWebview within a UIScrollView. Within the webview I have an embedded YouTube movie. When I play the YouTube movie everything works fine, however, when I press the fullscreen button the movie starts playing behind the webview. Bringing the WebView to the front does not work, because I want the scrolling capabilities of the ScrollView to do horizontal scrolling.
Basically, you want to be able to detect when a movie starts playing fullscreen and arrange your views appropriately. Then, when the fullscreen playback ends you want to be able to get your views back to how they are.
The problem is there's no documented way to hook into or detect when a UIWebView triggers video playback in full screen.
I said 'documented way', because there are some notifications you can use to detect when a UIWebView triggers fullscreen playback. You can just listen out for them and rearrange your views accordingly. However, I don't necessarily recommend this, because they're undocumented and subject to change (in fact, they have a spelling mistake in them up until iOS 4.3, see answers below).
// For iOS 4.3 and above:
UIMoviePlayerControllerDidEnterFullscreenNotification
UIMoviePlayerControllerDidExitFullscreenNotification
// For iOS 4.2 and below:
UIMoviePlayerControllerDidEnterFullcreenNotification
UIMoviePlayerControllerDidExitFullcreenNotification // (note spelling mistake)
Finding these out was a bit of a pain - there are actually several more notifications that get triggered when a YouTube video in a UIWebView gets played back. To find them out you'll need to drop a breakpoint on all posting of notifications, and then manually inspect the memory locations of those notifications to figure out their string names. I don't actually think anyone has pulled these out before, because when I google them I get nothing. But they do work, promise!
I hope being able to get notified when the fullscreen playback is entered/exited will be helpful, with the massive caveat that Apple could change this undocumented behavior at any time. Your app won't get rejected outright for using them (because you're not calling any undocumented methods), and I've used it in shipping apps. But it's still not the best idea in the world...may be the only option you have though.
Edit: To clarify, based off the comment below: they're not constants, so you'd need to put them in quotes if you were registered for notifications.
For iOS 4.3+, Apple have changed the names of these notifications:
UIMoviePlayerControllerDidEnterFullcreenNotification now is UIMoviePlayerControllerDidEnterFullscreenNotification
UIMoviePlayerControllerDidExitFullcreenNotification now is UIMoviePlayerControllerDidExitFullscreenNotification
Please pay attention: The term "Fullcreen" has changed to "Fullscreen".
Thanks!
Just wanted to confirm that this works after playing around with it for awhile. You can get direct access to the view that the video is playing in. This is a blocks method of registering for the notification and pulling out the pertinent views.
Notice: You will need to delay adding subviews and/or access Apple internal subviews to remove the navbar for further customization.
[[NSNotificationCenter defaultCenter]
addObserverForName:#"UIMoviePlayerControllerDidEnterFullcreenNotification"
object:nil
queue:nil
usingBlock:^(NSNotification *note){
MPMoviePlayerController *theMovieController = [note object];
UIView *theDestinationVideoView = [[note userInfo]
objectForKey:#"UIMoviePlayerControllerFullscreenViewUserInfoKey"];
}];

iPhone. Is it possible to load a video file and select a specific frame?

Is it possible to load a short video file and - once loaded - select a specific frame and display that frame in a view? If there is no native support for this, how about an open source alternative?
Thanks in advance.
-Doug
I think that in iphone programming you're stuck with the fullscreen video solution proposed by apple. You could write your own controller to do it differently, but i think it could be difficult to achieve good performances and you're cut out of the app-store for sure.
edit:
looks like in iphone sdk 3.2 apple added something for you:
The MPMoviePlayerController class
defines an interface for managing the
playback of a movie. Playback occurs
either in full-screen mode or in a
custom view that is vended by the
movie player controller. You can
incorporate the view into your own
view hierarchies or use a
MPMoviePlayerViewController object to
manage the presentation for you.
and again
Behavior in iPhone OS 3.1 and Earlier
In iPhone OS 3.1 and earlier, this
class implemented a full-screen movie
player only. After creating the movie
player and initializing it with a
single movie file, you called the play
method to present the movie. (The
definition of the play method has
since moved out of this class and into
the MPMediaPlayback protocol.) The
movie player object itself handled the
actual presentation of the movie
content.
i haven't tested it yet but have a look at the official documentation under MPMoviePlayerController Class Reference, it may help.

Pre-built audio player UI on iphone?

My boss seems to think there's a way to play audio files via a built-in QT interface that comes up with a modal UI, much like address book framework does.
Also, the mail app pops up a QT modal player to play attached audio files and then hides itself when done.
I've done a good 2 hours of research and I cannot find any pre-built UI for playing audio. I understand that I can do it via AVAudioPlayer, but that still requires I build a custom UI, which is fine, but we're looking for visual familiarity and consistency.
I just now found MPMusicPlayerController, but it appears to only play itunes media, not media from file paths.
So, is there a pre-built audio player UI?
MPMoviePlayerController can also be used to play audio files (although it's not recommended):
MPMoviePlayerController *mPlayer = [[MPMoviePlayerController alloc] initWithContentURL: [NSURL URLWithString:#"http://www.freeaudioclips.com/music1/Sound_Effects/austinmail.wav"]];
// Show Audio player just to test it out
if (mPlayer)
{
[mPlayer play];
}
Read Apple's Documentation and for more details.