QTMovieOpenForPlaybackAttribute alternative

Discussion in 'Mac Programming' started by fernandovalente, Feb 21, 2010.

  1. fernandovalente macrumors 6502

    fernandovalente

    Joined:
    Aug 29, 2008
    Location:
    Third world **** hole, I mean, Brazil
    #1
    Code:
    NSDictionary *att = [NSDictionary dictionaryWithObjectsAndKeys:[NSURL URLWithString:@"http://216.218.147.60:9014"], QTMovieURLAttribute, [NSNumber numberWithBool:YES], QTMovieOpenForPlaybackAttribute, nil];
    	
    I wrote this code, but I need to make this app run on Leopard. What should I use instead of QTMovieOpenForPlaybackAttribute?
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    QTMovieOpenForPlaybackAttribute on 10.6 is really just @"QTMovieOpenForPlaybackAttribute" so you can plug that in directly. For 10.5 there is no alternative so it shouldn't matter if you pass in an attribute that QTMovie doesn't understand.
     
  3. fernandovalente thread starter macrumors 6502

    fernandovalente

    Joined:
    Aug 29, 2008
    Location:
    Third world **** hole, I mean, Brazil
    #3
    Tried this:

    Code:
    NSDictionary *att = [NSDictionary dictionaryWithObjectsAndKeys:[NSURL URLWithString:@"http://216.218.147.60:9014"], QTMovieURLAttribute, [NSNumber numberWithBool:YES], nil];
    Got this error:

    Code:
    2010-02-21 23:17:33.957 Radio Tool X[23654:a0f] +[NSDictionary dictionaryWithObjectsAndKeys:]: second object of each pair must be non-nil.  Or, did you forget to nil-terminate your parameter list?
    The movie also won't play. How may I solve that please?
     
  4. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    Look at the arguments again. You're passing an uneven number of objects and keys.
     
  5. fernandovalente thread starter macrumors 6502

    fernandovalente

    Joined:
    Aug 29, 2008
    Location:
    Third world **** hole, I mean, Brazil
    #5
    This must be one of that foolish errors that I don't understand. I used this, but I got a QTMovieLoadStateError.

    Code:
    NSDictionary *att = [NSDictionary dictionaryWithObjectsAndKeys:[NSURL URLWithString:@"http://76.73.79.82:8688"], QTMovieURLAttribute, nil];
    I get this error no matter which URL I try. It used to work before removing
    Code:
    [NSNumber numberWithBool:YES], QTMovieOpenForPlaybackAttribute
     
  6. fernandovalente thread starter macrumors 6502

    fernandovalente

    Joined:
    Aug 29, 2008
    Location:
    Third world **** hole, I mean, Brazil
    #6
    Got the error:

    Code:
     Error Domain=NSOSStatusErrorDomain Code=-2048 UserInfo=0x10a2140 "The file is not a movie file."
    I don't know how to solve that :(
     
  7. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #7
    This is what you have as the URL:
    Code:
    @"http://216.218.147.60:9014"
    Unless that server is responding with a movie file when it's given no pathname or filename, you may need a little more to the URL.
     
  8. fernandovalente thread starter macrumors 6502

    fernandovalente

    Joined:
    Aug 29, 2008
    Location:
    Third world **** hole, I mean, Brazil
    #8
    Well, it works when QTMovieOpenForPlayback is set to YES. It doesn't make sense :(

    Code:
    	NSDictionary *att = [NSDictionary dictionaryWithObjectsAndKeys:[NSURL URLWithString:@"http://78.129.226.12:8700"], QTMovieURLAttribute, nil];
    	movie = [[QTMovie alloc]initWithAttributes:att error:&error];
    The error object is NULL. I really need to know how to solve that. :(
     
  9. fernandovalente thread starter macrumors 6502

    fernandovalente

    Joined:
    Aug 29, 2008
    Location:
    Third world **** hole, I mean, Brazil
    #9
    I don't know if that helps, but this is an audio stream.
     
  10. fernandovalente thread starter macrumors 6502

    fernandovalente

    Joined:
    Aug 29, 2008
    Location:
    Third world **** hole, I mean, Brazil
    #11
    It appears to work when using a pls file located on a remote server. Unfortunatelly, a pls file located on the mainbundle doesn't work. I tried getting the URL from this pls file, but I couldn't get it to work out of the pls file. :(
     
  11. fernandovalente thread starter macrumors 6502

    fernandovalente

    Joined:
    Aug 29, 2008
    Location:
    Third world **** hole, I mean, Brazil
    #12
    OK, I can give up supporting Leopard. That's not a big deal. But there's still one problem. I'm using the QuickTime API to get the metadata from the song. It doesn't work when QTMovieOpenForPlaybackAttribute is set to YES. If I knew any other way to do that, it would be a lot easier. QuickTime API really sucks, I can't even compile it as 64bit.

    Code:
    2010-02-22 18:14:08.360 Radio Tool X[26162:a0f] Tried to use QTMovie method quickTimeMovie, which is not allowed when QTMovieOpenForPlaybackAttribute is YES.
     

Share This Page