Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Playing a video on startup of app without controls?

TravrewTravrew Posts: 10Registered Users
I want to make an app that simply plays a video on startup of an application, but doesn't show all the controls, even if the screen is tapped. I would do this myself, but I have no idea how to write the codes and stuff. Could someone please write the code for me and post it here? Also, could you tell me where to paste the code in the SDK? Thanks, I hope I haven't tainted you with my newbity.
Post edited by Travrew on

Replies

  • SpeedSpeed Posts: 614Registered Users
    Travrew;385228 said:
    I want to make an app that simply plays a video on startup of an application, but doesn't show all the controls, even if the screen is tapped. I would do this myself, but I have no idea how to write the codes and stuff. Could someone please write the code for me and post it here? Also, could you tell me where to paste the code in the SDK? Thanks, I hope I haven't tainted you with my newbity.
    Copying and pasting code is not the way to learn, or to write an application. I'd look into using the MPMoviePlayerController class.
  • Duncan CDuncan C Posts: 8,015Tutorial Authors, Registered Users
    Travrew;385228 said:
    I want to make an app that simply plays a video on startup of an application, but doesn't show all the controls, even if the screen is tapped. I would do this myself, but I have no idea how to write the codes and stuff. Could someone please write the code for me and post it here? Also, could you tell me where to paste the code in the SDK? Thanks, I hope I haven't tainted you with my newbity.
    I figured out how to make our app play a full-screen video without controls, and dismiss the video when you tap the screen. It was kinda tricky.

    No, I'm not going to post the code and tell you where to paste it in. It's not that simple. Your question is the equivalent of asking somebody to explain where to cut in order to perform an appendectomy.

    You'd need to figure out how to adapt it to your needs. It would involve adding frameworks to your app, including headers, adding protocols, and various other things. Based on the level of questions you're asking, you would have no idea how to do those things, and would make helping you extremely painful.

    You either need to learn the fundamentals enough to understand the steps involved, or hire somebody to do it for you.

    If you would like to hire our company we can add these features to your app. I'm sure there are others on this forum who are also available for hire.
    Regards,

    Duncan C
    WareTo

    mug

    Animated GIF created with Face Dancer, available for free in the app store.
  • TravrewTravrew Posts: 10Registered Users
    Duncan C;385310 said:
    You'd need to figure out how to adapt it to your needs. It would involve adding frameworks to your app, including headers, adding protocols, and various other things. Based on the level of questions you're asking, you would have no idea how to do those things, and would make helping you extremely painful.
    The app I'm trying to make won't have any other features other than playing a video, and I don't want it to dismiss when tapped. Could you please just post the code here, and I'll just figure out the rest? I promise I won't cause you any pain. ;)
  • Duncan CDuncan C Posts: 8,015Tutorial Authors, Registered Users
    Travrew;385326 said:
    The app I'm trying to make won't have any other features other than playing a video, and I don't want it to dismiss when tapped. Could you please just post the code here, and I'll just figure out the rest? I promise I won't cause you any pain. ;)
    It's about 40 lines of code. If you are not an experienced iOS developer I doubt it will be very useful to you. I'm providing the code below "as is". I'll answer questions about it and help you get it working in your program - if you hire me by the hour to do so.

    Sorry if that seems harsh, but I sense that otherwise this could involve dozens of questions and answers, and I'm not signing up for that.

    - (IBAction) videoAction:(id)sender
    {
    if (myMovie)
    return ;

    NSString* a_path = [[NSBundle mainBundle] pathForResource:@\"kevin-kell-introduction\" ofType: @\"mp4\"];

    if (a_path==nil)
    return ;

    NSURL* a_url = [NSURL fileURLWithPath:a_path];

    if (a_url==nil)
    return ;

    Class moviePlayerViewControllerClass = (NSClassFromString(@\"MPMoviePlayerViewController\"));
    newStyleVideoPlayer = moviePlayerViewControllerClass && [MPMoviePlayerViewController instancesRespondToSelector: @selector(presentMoviePlayerViewControllerAnimated:)];
    if (newStyleVideoPlayer)
    {
    //We're running in iOS 3.2 or later, so use the new MPMoviePlayerViewController class.

    MPMoviePlayerViewController* movie_controller = [[[MPMoviePlayerViewController alloc] initWithContentURL:a_url] autorelease];

    if (movie_controller) {
    self.myMovie = movie_controller;

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playBackFinished:) name:@\"MPMoviePlayerPlaybackDidFinishNotification\" object:nil];

    MPMoviePlayerController* theMoviewPlayer = movie_controller.moviePlayer;
    theMoviewPlayer.controlStyle = MPMovieControlStyleNone;
    //theMoviewPlayer.fullscreen = TRUE;

    [[UIApplication sharedApplication] setStatusBarHidden: TRUE withAnimation: UIStatusBarAnimationNone];
    [self presentMoviePlayerViewControllerAnimated: (MPMoviePlayerViewController*)self.myMovie];
    }
    }
    }
    Regards,

    Duncan C
    WareTo

    mug

    Animated GIF created with Face Dancer, available for free in the app store.
  • TravrewTravrew Posts: 10Registered Users
    Duncan C;385343 said:
    It's about 40 lines of code. If you are not an experienced iOS developer I doubt it will be very useful to you. I'm providing the code below "as is". I'll answer questions about it and help you get it working in your program - if you hire me by the hour to do so.

    Sorry if that seems harsh, but I sense that otherwise this could involve dozens of questions and answers, and I'm not signing up for that.

    - (IBAction) videoAction:(id)sender
    {
    if (myMovie)
    return ;

    NSString* a_path = [[NSBundle mainBundle] pathForResource:@\"kevin-kell-introduction\" ofType: @\"mp4\"];

    if (a_path==nil)
    return ;

    NSURL* a_url = [NSURL fileURLWithPath:a_path];

    if (a_url==nil)
    return ;

    Class moviePlayerViewControllerClass = (NSClassFromString(@\"MPMoviePlayerViewController\"));
    newStyleVideoPlayer = moviePlayerViewControllerClass && [MPMoviePlayerViewController instancesRespondToSelector: @selector(presentMoviePlayerViewControllerAnimated:)];
    if (newStyleVideoPlayer)
    {
    //We're running in iOS 3.2 or later, so use the new MPMoviePlayerViewController class.

    MPMoviePlayerViewController* movie_controller = [[[MPMoviePlayerViewController alloc] initWithContentURL:a_url] autorelease];

    if (movie_controller) {
    self.myMovie = movie_controller;

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playBackFinished:) name:@\"MPMoviePlayerPlaybackDidFinishNotification\" object:nil];

    MPMoviePlayerController* theMoviewPlayer = movie_controller.moviePlayer;
    theMoviewPlayer.controlStyle = MPMovieControlStyleNone;
    //theMoviewPlayer.fullscreen = TRUE;

    [[UIApplication sharedApplication] setStatusBarHidden: TRUE withAnimation: UIStatusBarAnimationNone];
    [self presentMoviePlayerViewControllerAnimated: (MPMoviePlayerViewController*)self.myMovie];
    }
    }
    }
    Thank you so much, I finally got it to work!
  • DomeleDomele Posts: 2,947Registered Users
    You're too nice Duncan. I doubt he'll actually learn anything from this and now he has it in his head that he can get free code.
    If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.



    New app - See screenshots and details at www.globaclock.com.



    If you want to
  • TravrewTravrew Posts: 10Registered Users
    Domele;385400 said:
    You're too nice Duncan. I doubt he'll actually learn anything from this and now he has it in his head that he can get free code.
    I have no evident future in coding, so there's no need to do any learning. Also, this is my first and last iPhone SDK project, so don't worry about me running around asking for free code. So, I suppose this is my last post on this forum. I hope you all don't miss me and my 4 posts.
  • Duncan CDuncan C Posts: 8,015Tutorial Authors, Registered Users
    Domele;385400 said:
    You're too nice Duncan. I doubt he'll actually learn anything from this and now he has it in his head that he can get free code.
    I started to refuse, and then thought "what the heck". Maybe he can figure out enough to make it work. It sounds like he did. That's a good sign.
    Regards,

    Duncan C
    WareTo

    mug

    Animated GIF created with Face Dancer, available for free in the app store.
  • MobiusStripMobiusStrip Posts: 1New Users
    Domele;385400 said:
    You're too nice Duncan. I doubt he'll actually learn anything from this and now he has it in his head that he can get free code.
    What a bullshit attitude. Thousands (if not tens of thousands) learned to program by copying code from Compute or Byte magazine line by line without understanding it until it was time to modify it.

    Both of you can shove your smug remarks. In the meantime, you look petty and embittered by your own failures.
Sign In or Register to comment.