Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 840817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:41:20+00:00 2026-05-15T05:41:20+00:00

I have a video that I play. To use full screen in iOS 3.2

  • 0

I have a video that I play.
To use full screen in iOS 3.2 I use the MPMoviePlayerViewController (seems to only work with that Class). But if I want to build for iOS 3.0 I obviously get several errors, because this class is not known in iOS 3.0. I also know how to get what I want with MPMoviePlayerController in iOS 3.0, but I can only have one, either the code for iOS 3.0 or the code for iOS 3.2.

How to cope with that ? – Solution found (see bottom of bundled edit)

I guess I have to use multiple targets, do you have suggestions on how to do that (always when I tried multiple targets I got errors and gave up 🙂 ) ?


Edit bundled (multiple edits combined)

First I thought this would work.

#ifdef __IPHONE_3_0
// OS 3.0 specific
#endif

But it doesn’t because in the iOS’s Availability.h files you have all OS’s defined from 2.0 up to your current one. So if you compile for iOS 3.2 the #ifdef __IPHONE_3_0 will return true as well.

Then I thought this would work

#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
  // Code for older iOS
#else
  // Code for iOS 3.2 up
#end

But it doesn’t also. Because in iOS 3 for example __IPHONE_3_2 is undefined.

So I thought I would have to create some more intelligent if/elseif/else block but then I (finally :D) read the comment above the __IPHONE_X_X in apples AvailabilityInternal.h file definitions:

It says that you can use __IPHONE_OS_VERSION_MIN_REQUIRED for exactly that kind of problem, but that you shouldn’t use the __IPHONE_X_X constants because of what just happened to me… they simply might not be defined thus evaluating to 0. So they recommend to use the values instead. So I have a working selector now like this…

Solution that I found

(Now this really works 100 %)

#if __IPHONE_OS_VERSION_MIN_REQUIRED < 30200
  // code for iOS below 3.2
#else
  // code for iOS 3.2 ++
#endif
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:41:21+00:00Added an answer on May 15, 2026 at 5:41 am

    I’m not sure if this is what you are trying to do, but as per Apple’s recommendation for universal apps in the iPad Programming Guide, if you want to build for multiple OS versions with inconsistent APIs, you should use NSClassFromString, and go from there. This way, you only have to have one target (the lowest OS you support) and through out your code have things like

    Class mplayerControllerClass = NSClassFromString(@"MPMoviePlayerViewController");
    if(mplayerControllerClass != nil) {
       //Code for 3.2, e.g. [mplayerControllerClass alloc]
    } else {
       //Code for pre-3.2 OSes
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a video view that is full screen and would like to trigger
I have a project that needs to play video but not allow downloading. I'd
I have a video that I want to use on an app that has
I want to write Android application that will play HLS video. I use default
I am trying to play a video from video path that I have in
in my application i have the playvideo page where video will play, below that
I want to use Qt to create a simple GUI application that can play
I use MediaElement to play video in my app, and have a question about
I'm trying to play a video and have a button that switches the video
I have a webview that has html video inside it. I want to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.