I have an app and would like to have a video loop in the background of my initial view. It will serve as my home screen and menu and will have buttons overlaying on top of it. I have looked around but can't seem to find a guide or tutorial on this.
Take a look at MPMoviePlayerController for what is probably the most approachable way to attack the video idea.
MPMoviePlayerController will very quickly let you present a fullscreen interface, but will require a bit more work to use it "in-line" which is what you are describing.
Otherwise you'll find yourself wandering down the AVAsset path, which will allow far more control over what is happening, but will require quite a bit more code to configure.
As far as 3rd party options go, using the excellent GPUImage will allow you to throw a video at a view quite seamlessly and with very little code written on your part (the "SimpleVideoFileFilter" project in the examples can show you the way). But since you are merely displaying a video, this would be a significant amount of bloat for your project.
Bigger picture, using Animations instead of a movie has lots of appeal, for the performance, battery life, and general responsiveness of your app reasons stated by others.
Related
I have a MPMoviePlayerController instance in my iOS app, that plays a local file in fullscreen mode. This all works fine, but now I want to add a custom button to the window for changing the playback speed. We support both iPhone and iPad in all orientations.
I know how to set the playback speed from code (using setCurrentPlaybackRate), but I need to let the user do it while watching the video, which means adding some kind of button to the playback screen next to the existing buttons, e.g. next to "play", "pause", or in the top bar.
By looking on StackOverflow I have found various replies for questions similar but not quite the same, some saying it cannot be done in fullscreen, some saying it can be done (but is very complex) by creating some kind of overlay, effectively replacing the entire overlay with a custom one.
Although, I have yet to find any code examples (apart from a few snippets without context), getting-started style tutorial or similar for this, so any pointers to example code would be greatly appreciated.
maybe this Apple example could help you
https://developer.apple.com/library/ios/samplecode/MoviePlayer_iPhone/Introduction/Intro.html
TL:DR
What technique does Apple use to make Photo.app so fast, even with large images?
Long Version
I watched Apple's WWDC 2010 video about scroll views to learn how to replicate Photo.app pagination behavior and low memory utilization (PhotoScroller Demo). It works well, but since images are loaded only when they are needed, when I try to paginate to another image, the app locks while the JPEG is being decompressed.
The same video shows a tiling technique to get better performance, but since I'm using photos taken from the camera and stored in the app, that doesn't seem feasible (having multiple copies of each photo, in different resolutions, would consume too much space - 4MB vs 27MB). Also, using iExplorer I noticed Photo.apps has only a copy of each photo (it doesn't even have a small thumbnail copy for the gallery).
What technique did Apple use to make Photos.app so fast? How can I get that same performance in my app?
I'm a bit confused if this should be here or on Programmers,
since there's no code in the question, but F.A.Q. says that algorithm
questions are part of Stackoverflow, and the tags here match it
better.
So if you just show one image fullscreen you can do this:
In the WWDC11 Session 104 - Advanced Scroll View Techniques they talk about infinite scrolling and how to do it. The basic idea is to scroll the view and after scrolling reposition the (UIImage)view inside the scroll view so it appears centered or whatever you layout constraints are.You could then load the new UIImage into the UIImageView. Since you only have one UIImageView it should be pretty low memory consuming. I am not sure about how the loading times of the images will behave though.
Maybe preload the next UIImage to the left and right to the current image and then load it into the UIImageView after reposition the scrollView can help here.
For anyone who is still looking for simply implementation of scroll view that hold lot's of images.
https://github.com/sumofighter666/ReusableScrollView
It is as simply as implementing UITableView
I know that UIAppearance has been introduced in iOS 5, but is there any way of using the new protocol to reskin the MPMoviePlayerController, or do I still need to get my hands dirty using drawRect methods and the like?
Does anyone have any good examples of reskinned movie players for the iPad?
MPMoviePlayerController's user interface is entirely transparent for you as a developer. You can not change its appearance at all. You can only replace the UI by hiding the default interface and showing your own as explained in detail within the following SO answers:
To what extent can the iOS Movie Player be customized and styled?
Adding custom controls to a full screen movie
One additional note though:
Even though this does enable you to create a customized movie player, Apple clearly recommends against doing that - and once again for good reason. The player, as is, does provide a well functioning, good looking and accustomed UI to the end user. Customizing the interface, in almost all attempts, will reduce the usability. Trust me, I have done it numerous times for various customers that insisted in having their branded player - yet I have never encountered a design that feels as good as the one Apple provides you with.
I'm working on a native Objective-C iOS app and I'm wondering if it is possible to embed an animation created in Flash into my app. The animation doesn't have to be interactive, all I need is a couple of animated screens (intro screen, loading screen). Is this posible?
Maybe the long way around since it doesn't sound like you need a Flash-heavy type app but I have seen a few Flash-toCocoa2D exporters around. I haven't got around to trying them yet but they look useful. Of course you probably have to be using the Cocoa2D frame work to use them - unless there is an easy way to extract + repurpose that relevant code from the Cocoa2D source.
Anyway, probably overkill for what you need but here are some links:
http://dl.dropbox.com/u/514219/FlashToCocos2dAnimation.zip
VID of it in action:
http://www.youtube.com/watch?v=8ZyqGrdkTtM
Another tool:
http://marshgames.com/swftoxml-and-importing-flash-scenes-into-cocos2d-on-iphone/
Nope...Apple will reject any app that uses flash
you could use video player for intro screen (i've seen it on a few apps) or simple picture animation using UIView animation methods
here is a tutorial
I'm making internet radio app for iPad and I was wondering if there are standard or custom implementations of iPad Music app-like interface. I mean thumbnails of albums and when you tap on a thumbnail - cover animation and presenting another controller. Is there something for that? Thanks a lot
Nope. There are bits and pieces of code that don't really work (those are all separate links), but they're a good start for getting something like coverflow working.
Also, you might want to try showing examples of what you have already found in your searching, or any code/UI you've already implemented. Most people on SO are happy to help, but don't take well to 'I haven't put any effort into this yet, please show me all the code I need for my project'. Even if you have put effort in, if you post a 2 sentence question with no demonstrable work, people will assume the worst. Best of luck.