Quicktime Framework and opening Transport Streams
I have noticed that Quicktime 10 is now able to open Transport Stream Video files and also search reliably within that video file(Which is something that VLC can not seem to handle). Quicktime 7, on the other hand, is not able to open the same Video File.
When I try to open that same Video File within my Cocoa Application, which is using the QTKit framework, I get the error that the selected file is not a movie file.
Are there anyways to work around this?
Also, does anyone know the difference between the Quicktime Player and the QTKit that is supplied to developers? I made the assumption that the QTKit framew开发者_如何学Goork would backing the player but this does not seem to be the case.
QuickTime Player should use an almost identical backing as any other app on the system: QTKit. What might be happening is that QuickTime Player in Snow Leopard is using the newly introduced QuickTime X system, rather than the more venerable QuickTime 7. Read up on QuickTime X and see if that helps. (It should boil down to specifying that you want playback only when opening the URL).
It seems that QTKit by default uses QuickTime 7 but can be made to use QuickTime X by setting the QTMovieOpenForPlaybackAttribute attribute. This will disable some quick time features like setting the selection and playing the selection but QTKit will now be able to play Transport Streams.
You can read more about it with in the following pdf.
http://macguild.org/wwdc/wwdc-2009.pdf
I understand this is quite irrelevant to the question asked. However, I hope it will help someone wandering around to know how to open a URL from a Cocoa app with the default QuickTime Player application and not the ugly QTMovieView etc. I'd to spend a good deal of time and labour googling about it but all in vain.. I hope it will save someone's day.
NSString *url = [NSString string];
url = @"http://someurl";
[[NSTask launchedTaskWithLaunchPath:@"/usr/bin/open" arguments:[NSArray arrayWithObjects:url , @"-a", @"QuickTime Player", nil]]
waitUntilExit];
精彩评论