• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
QTMovie to handle NSData of an mp3?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

QTMovie to handle NSData of an mp3?


  • Subject: QTMovie to handle NSData of an mp3?
  • From: "Patrick Crosby" <email@hidden>
  • Date: Thu, 29 Mar 2007 09:43:23 -0400

So the following works if I have a quicktime movie in a file that I
want to store as NSData:

   data = [[NSFileManager defaultManager] contentsAtPath:path];
   [self setValue:data forKey:@"data"];

then later on, I can do:

   NSData* data = [self valueForKey:@"data"];
   QTMovie* movie = [[QTMovie alloc] initWithData:data error:&err];

And everything works fine.

BUT, if the file is an mp3, when I try to load the NSData into a
QTMovie, I get an error "the file is not a movie file".

To get it to sort of work, I did this:

    QTMovie* movie = [[QTMovie alloc] initWithFile:path error:nil];
    data = [movie movieFormatRepresentation];
    [self setValue:data forKey:@"data"];

this "works" in that I can create a QTMovie from the data using the
second snippet above, but the NSData doesn't contain the full mp3
file, just a reference to the file (if I delete the mp3 file fully, it
doesn't work).

So, how can I get the full mp3 file into NSData that can be used to
create a QTMovie?

thanks for your help.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: QTMovie to handle NSData of an mp3?
      • From: Martin Wennerberg <email@hidden>
  • Prev by Date: Re: can itunes display artwork without embedding the cover
  • Next by Date: Re: QTMovie to handle NSData of an mp3?
  • Previous by thread: Re: NSConnection, NSSocketPort, and timeouts
  • Next by thread: Re: QTMovie to handle NSData of an mp3?
  • Index(es):
    • Date
    • Thread