Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using an Open Cover Flow for video slides instead of images in iOS

Can you have a Cover Flow of multiple videos instead of images in iOS? The user would see a still of the start of each video with the play button instead of images, kind of like Youtube.

So instead of a set of images like the current Cover Flow in iOS, it would be a set of videos. Or Videos and images mixed up.

like image 645
Free Lancer Avatar asked Dec 23 '11 00:12

Free Lancer


2 Answers

iCarousel is the framework I would use in this case. It is a CoverFlow replacement library, as CoverFlow is an undocumented API under iOS. See the description on the GitHub site and read the note below.

Unlike many other "CoverFlow" libraries, iCarousel can work with any kind of view, not just images, so it is ideal for presenting paged data in a fluid and impressive way in your app.

I haven't tried it myself with video objects, but from the documentation and this, it would seem you can pass in video objects or thumbnails that when clicked, load a video. Performance-wise, thumbnails would make much more sense. Below is source code from the readme with explanation for how to use it.

The iCarousel follows the Apple convention for data-driven views by providing two protocol interfaces, iCarouselDataSource and iCarouselDelegate. The iCarouselDataSource protocol has the following required methods (note: for Mac OS, substitute NSView for UIView in method arguments):

- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel;

Return the number of items (views) in the carousel.

- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view;

Return a view to be displayed at the specified index in the carousel. The reusingView argument works like a UIPickerView, where views that have previously been displayed in the carousel are passed back to the method to be recycled. If this argument is nil, you can set its properties and return it instead of creating a new view instance, which will slightly improve performance. Unlike UITableView, there is no reuseIdentifier for distinguishing between different carousel view types, so if your carousel contains multiple different view types then you should just ignore this parameter and return a new view each time the method is called. You should ensure that each time the carousel:viewForPageAtIndex: method is called, it either returns the reusingView or a brand new view instance rather than maintaining your own pool of recyclable views, as returning multiple copies of the same view for different carousel item indexes may cause display issues with the carousel.

So for the second method, you could implement a UIImageView that was a thumbnail for the video, and reuse a view each time for each video. The upside of this is that you could mix images and videos, differentiating only when you needed to display the image/video fullscreen. And it would be as simple as querying the class, then setting up a different view to be displayed based on the class. Is that enough info? Tell me if something isn't clear.

like image 83
Dylan Gattey Avatar answered Oct 17 '22 08:10

Dylan Gattey


Why not use thumbnail images to represent the videos? When the image is pressed, the video loads. This would make the application use less processing power, and allow integration with current iOS cover flow methods.

If you really want to make a video cover flow, you would probably need to write the code to create it from scratch. I would think that it is possible though.

like image 4
dgund Avatar answered Oct 17 '22 10:10

dgund