开发者

Quicktime Framework and opening Transport Streams

开发者 https://www.devze.com 2022-12-15 07:14 出处:网络
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 t

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号