iOS Video Preview in DetailViewController - ios

I need an advise regarding to video preview in DetailViewController. I have a tableView based app. I will have some content in my tableView and I want users to tap on the cell and go to the DetailViewController. So far, I was able to get users do this. I have the following storyboard at the moment. But it contains UIImageView in it.
IMAGE: http://cl.ly/image/0c3V121X0T0M
As you can see, I have thumbnailView and some label containing information and again UIImageView in detailViewController. My aim is to show a video on the DetailViewController instead of a UIImageView and some info related to that video. It would be better for me fetch the videos, so I don't need to push new updates every single time I make changes on the videos.
Do you happen to have an answer or any sources that can help me out with this? I have had a look at the resources available but couldn't come up with solid solution so far.
Please let me know if I should provide more regarding to my question.

You need to look at AVFoundation and AVPlayer.
Download Sample from here

Related

Wallpapers app iOS

I'm just trying to create a simple app, that would work as a wallpaper app. But i need to get the images off interwebs. So I thought I would get a rss feed of images and and basically have a rss reader that only has images. But I thought. . . I need a preview for the images in the main viewcontroller, so I would use just a image view for that, but it needs to be able to let the user be able to click on the preview image and take the user to another viewcontroller that will have the full size image. So should I try to put the preview images in a button? and let the button take the user to another viewcontroller with a full size imageview and somehow have the image display their. Sorry if this is confusing, this is the only way i thought how to do this. If their is an easier way, please tell me. And when it comes to, when the user wants to download the image online, i can just hook up some outlets for some buttons on the viewcontroller and link them together with the image, and put some code for saving the image. Would that work?
Ok, so let me get this straight:
You want to create an app that retrieves images from the internet, displays them to the user, and when the user clicks on an image, he/she is presented with a fullscreen view of that image?
There are a number of options you can pick from. Here are just a few suggestions:
You can use the image as the image for a UIButton
You can make the UIImageView call a function when it's tapped (using either a UIGestureRecognizer, or just implementing the touchesBegan: method).
You can put an invisible UIButton over the UIImageView
When displaying the image, you add an UIImageView to the UIViewController and hook it up using an IBOutlet (unless you're creating the layout in code). Then in the code, you would convert the downloaded image (NSData) into a UIImage, and then display this in the UIImageView.
It seems as you're a beginning iOS Developer, and I respect that you're trying to learn by doing. However, I suggest that you start off with reading some introductory tutorials before you begin your first project. Otherwise you might waste a lot of time. Here's a very good guide on how to get started! Good luck :)

Displaying both video and image in a single view element

I'm attempting to create an Instagram styled app and cannot figure out a way to display media in a UITableView the way they do (either video or image in a single view). I know it most likely is a custom implementation of UIWebView or something of the sort, however I have no idea where to even begin writing a subclass like that. Things I've already tried include:
Using a UIWebView (massive memory leak, even when adding/removing the views programmatically).
Adding either UIImageView or UIWebView depending on whether or not it was a video or image (again had a memory leak)
Searching the internet for a possible way to do this
If anyone could help me out that would be awesome! FYI the media I am using is grabbed straight from my server, there is no data being gathered from a popular source such as YouTube, Flickr, etc.
i think they use UICollectionview as it allows for better customization of a table.
In terms of images and videos, use UIImageView to display all your images and MPMoviePlayerController to play videos.

Using PageViewController for a large number of pages like camera roll image view?

I am trying to create an app for which I need a way to swipe through views. For example, while swiping through images in photo stream or camera roll. I DO NOT need to swipe through images however, I need to swipe through UIViews. I have been looking at PageViewController. However, setViewControllers:direction:animated:completion: suggests that I need a ViewController for every UIView. This doesn't seem to be what I want since I will have over 40 views that I will need to scroll through. I think I'm missing an obvious ios feature here since even iBooks has a way to go through pages of books.
I was thinking maybe having 3 ViewControllers and changing their content whenever I swipe across. But that seems very roundabout.
Please help me out!
Thanks!
Apple has provided a fairly robust example of doing this kind of thing with photos called "PhotoScroller" at http://developer.apple.com/library/ios/#samplecode/PhotoScroller/Introduction/Intro.html. It uses UIScrollViews and CATiledLayers to recreate the experience of the Photos app. You may be able to modify it to work with your UIViews instead of images.

File Download UIWebView to UITableView

i managed to make a downloader with UIWebView. what i want to do is, when the download starts,
it should start in a different viewcontroller say tableView.
I have a tabbar controller in which last tab is downloads, i want my download to show there, including progress bar in tableViewCell.
If i pass the grabbed url to tableView, and start download from there, its not working.
Sorry if i am not making it clear.. cause i am confused myself.
Regards,
Malhaar
Try this one, quite good. Works background as well.

Using UIImagePicker in a tabbed UIPopover

I am developing an iPad app that needs to have multiple image sources, on the device/Photo Albums, remote and some included with the app. Now the ideal situation would be to have a UIPopover controller with 3 tabs for each source. The only problem is I can't seem to figure out how to have a UIImagePicker be in its own tab. What I am trying to do is very similar to Apple's Keynote for iPad. The photo icon's popover has tabs and the far left tab called media for sure has a UIImagePicker in there. I have no idea how they did that, is it possible for me to do something like that? I think the main issue is that the Image Picker is it's own navigation controller and it cannot be pushed on to another navigation controller. Any help would be greatly appreciated!
check out this - https://github.com/key1jp/ELCImagePickerController
you can implement it with custom asset library
The built-in image picker is no good.
Create your own image picker and add it to your navigation controller as a normal view. Start from either the Matt Tuzzolo or the MyImagePicker from the WWDC 2010 sample code. Note that you probably want to add image and video preview - I copied the image viewer from MyImagePicker and added a 'add' or 'remove' button to it, and the same for video.
Your image picking is in two steps, one for selecting the group, and one for selecting the assets within the group. I recommend dividing the first step into a two - if there is only one, then go directly to that group, i.e. when you have found the first group, check whether that group was the last (block stop argument). Then push the right view controller.
Obiously modify the size of the thumbnails also, they are iPhone size now. Adding a line of metadata (icon and duration) looks much nicer and is more informative for video.
I also recommend adding a 'click-and-hold' function for extended information after like 2 seconds.
Handle different sources by creating a protocol which gives you what you want, i.e.
-(BOOL)isImageAtIndex:(NSInteger)index;
-(UIImage*)thumbnailForUndex:(NSInteger)index;
-(void)setSelectedAtIndex:(NSInteger)index;
Creating a source which handles local files, included resources and assets is perfectly possible - I use NSURLs and check on the url scheme.
Are you not using UITabBarController for your tabs? You should be able to add a UIImagePickerController directly to viewControllers. I'm not sure whether that is a supported use of the image picker, though; the documentation only mentions displaying it modally or displaying it in a UIPopoverController.
It's not usually useful to look at an Apple app to find out what you can do with various built-in controls, as Apple allows themselves to use private APIs.

Resources