QTMovie to handle NSData of an mp3?
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