Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-17-2011, 02:33 PM   #1 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default How do you use a video as a background in a nib file instead of image?

Hey all, i have seen some apps that use a video as a background on their nib file and they have their navigation (UIButtons) on top of the video. How do i do something like that? thanks all.
grem28 is offline   Reply With Quote
Old 02-17-2011, 04:39 PM   #2 (permalink)
Registered Member
 
Join Date: Jan 2011
Location: South Florida, US
Posts: 357
lgehrig1 is on a distinguished road
Default

Quote:
Originally Posted by grem28 View Post
Hey all, i have seen some apps that use a video as a background on their nib file and they have their navigation (UIButtons) on top of the video. How do i do something like that? thanks all.
Well ... just like it sounds

The controls have a Z order associated to them. So you can put controls over controls, views over views, etc. If you are using IB, put your video player first, then drag buttons over top. Or, if you've already got thing setup in IB, drag the video player to the top of your view list - it's organized from back-to-front.

If you're doing it all programmatically, add your buttons after you add your video player.

You will probably also want to play with alpha values to help show the video behind the button, and if you are using images for the buttons (probably a good idea) use lots of transparency - it's why we love PNG. With an image containing transparency you can size the text appropriately, ensure enough square footage for user fingers, and still see the video behind it.

Caution: TEST TEST TEST. If your video takes a good bit of CPU to decode, it may stutter and stall with all the UI elements over it. You can try simplifying your video, or - if you own the video stream, embed your "buttons" into the stream and watch for touch events (no UIButtons) on the video player itself. Then it's just math.
lgehrig1 is offline   Reply With Quote
Old 02-17-2011, 07:02 PM   #3 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by lgehrig1 View Post
Well ... just like it sounds

The controls have a Z order associated to them. So you can put controls over controls, views over views, etc. If you are using IB, put your video player first, then drag buttons over top. Or, if you've already got thing setup in IB, drag the video player to the top of your view list - it's organized from back-to-front.

If you're doing it all programmatically, add your buttons after you add your video player.

You will probably also want to play with alpha values to help show the video behind the button, and if you are using images for the buttons (probably a good idea) use lots of transparency - it's why we love PNG. With an image containing transparency you can size the text appropriately, ensure enough square footage for user fingers, and still see the video behind it.

Caution: TEST TEST TEST. If your video takes a good bit of CPU to decode, it may stutter and stall with all the UI elements over it. You can try simplifying your video, or - if you own the video stream, embed your "buttons" into the stream and watch for touch events (no UIButtons) on the video player itself. Then it's just math.
Thanks for the response. I know about the z-order and stuff. what i was wondering was HOW to get the video in the background? I tried dropping the video in my resources and then tried to select it with IB from the drop down (when i select the UIImage) but it doesn't show up.
grem28 is offline   Reply With Quote
Old 02-17-2011, 09:33 PM   #4 (permalink)
Registered Member
 
Join Date: Jan 2011
Location: South Florida, US
Posts: 357
lgehrig1 is on a distinguished road
Default

Quote:
Originally Posted by grem28 View Post
Thanks for the response. I know about the z-order and stuff. what i was wondering was HOW to get the video in the background? I tried dropping the video in my resources and then tried to select it with IB from the drop down (when i select the UIImage) but it doesn't show up.
Then why all the dreck about buttons?

Check out MPMoviePlayerController. There's a fantastic code snippet in the Apple doc class ref, practically a straight copy & paste.
lgehrig1 is offline   Reply With Quote
Old 02-17-2011, 09:43 PM   #5 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by lgehrig1 View Post
Then why all the dreck about buttons?

Check out MPMoviePlayerController. There's a fantastic code snippet in the Apple doc class ref, practically a straight copy & paste.
LOL.... what i'm trying to do is create a video background with an buttons/text fields on top. Check out this app (Free).

Red Foundry VIZ for iPhone, iPod touch, and iPad on the iTunes App Store

You'll see what i'm talking about when you launch it.
grem28 is offline   Reply With Quote
Old 02-18-2011, 12:47 AM   #6 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,586
JasonR is on a distinguished road
Default

That app does not look to me like it has a video behind it. At first I thought it could be an animated UIImageView, but watching it for a while I'm convinced it's an OpenGL particle animation. I imagine Cocos2d would be the easiest way to do it if you don't want to learn OpenGL yourself.
JasonR is offline   Reply With Quote
Old 02-18-2011, 08:19 AM   #7 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by JasonR View Post
That app does not look to me like it has a video behind it. At first I thought it could be an animated UIImageView, but watching it for a while I'm convinced it's an OpenGL particle animation. I imagine Cocos2d would be the easiest way to do it if you don't want to learn OpenGL yourself.
How do you animate a UIImage View anyway? I have a 1024x1024 image that i want to place in the ipad. I want the image to start on the left and slowly move to the rightmost part of the image. When i drag the UIImageView to IB it automatically becomes the size of the screen. I'm used to flash so i don't know if i was doing it correctly but i was trying to make the UIImageView larger than the screen and somehow tween it to the left. it wouldn't let me make it larger.
grem28 is offline   Reply With Quote
Old 02-18-2011, 08:26 AM   #8 (permalink)
Registered Member
 
Join Date: Feb 2011
Location: Bucharest, Romania
Age: 22
Posts: 75
nestedloop is on a distinguished road
Default

Quote:
Originally Posted by grem28 View Post
How do you animate a UIImage View anyway? I have a 1024x1024 image that i want to place in the ipad. I want the image to start on the left and slowly move to the rightmost part of the image. When i drag the UIImageView to IB it automatically becomes the size of the screen. I'm used to flash so i don't know if i was doing it correctly but i was trying to make the UIImageView larger than the screen and somehow tween it to the left. it wouldn't let me make it larger.
You can resize virtually all components that you can see in IB from the third tab of the Inspector (the one with the yellow ruler symbol on it).
nestedloop is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone sdk, iphonesdk

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 372
13 members and 359 guests
cpsclicker, dre, Error404, Gaz, gmarro, jeroenkeij, Kirkout, Music Man, PavelMik, teebee74, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:10 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0