QTMovie 委托方法未被调用

发布于 2024-10-21 08:05:38 字数 1617 浏览 8 评论 0原文

嘿,我试图捕获 QTMovie 进度委托方法调用,但委托方法似乎没有被调用。我试图通过实现

- (BOOL)movie:(QTMovie *)movie ShouldContinueOperation:(NSString *)op withPhase:(QTMovieOperationPhase)phase atPercent:(NSNumber *)percent withAttributes:(NSDictionary 来捕获转换进度事件*)属性

但该方法没有被调用。我在这里查看了苹果示例代码 http://developer.apple.com/library/mac/#samplecode/QTKitProgressTester/Introduction/Intro.html#//apple_ref/doc/uid/DTS10003631并且似乎看不到我的代码和他们的代码之间有很大差异。该文件被很好地转换并显示在我的桌面上,我可以毫无问题地播放它。我只是无法获取进度事件。有什么想法吗?这是我用来测试这个的演示应用程序。

#import "testProjAppDelegate.h"
#import <QTKit/QTKit.h>
@implementation testProjAppDelegate

@synthesize window;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    QTMovie* movie = [QTMovie movieWithFile:@"/Users/Morgan/Desktop/sample_iTunes.mov" error:nil];

    if (movie)
    {
        [movie setDelegate:self];

        NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], QTMovieExport, 
                              [NSNumber numberWithInt:kQTFileType3GPP], QTMovieExportType, nil];


        [movie writeToFile:@"/Users/Morgan/Desktop/test.mp4" withAttributes:dict error:nil];

        NSLog(@"DONE");
    }
}

- (BOOL)movie:(QTMovie *)movie shouldContinueOperation:(NSString *)op withPhase:(QTMovieOperationPhase)phase atPercent:(NSNumber *)percent withAttributes:(NSDictionary *)attributes
{
    NSLog(@"PROGRESS");
    return YES; 
}

@end

Hey, I'm trying to trap the QTMovie progress delegate method calls, and the delegate methods don't seem to be getting called. I'm trying to trap the conversion progress event by implementing

- (BOOL)movie:(QTMovie *)movie shouldContinueOperation:(NSString *)op withPhase:(QTMovieOperationPhase)phase atPercent:(NSNumber *)percent withAttributes:(NSDictionary *)attributes

but the method is not getting called. I've looked at apples sample code here http://developer.apple.com/library/mac/#samplecode/QTKitProgressTester/Introduction/Intro.html#//apple_ref/doc/uid/DTS10003631 and can't seem to see very much difference between my code and their code. The file gets converted fine and shows up on my desktop and I can play it without issues. I just can't get the progress events. Any ideas? Here is my demo app that I'm using to test this with.

#import "testProjAppDelegate.h"
#import <QTKit/QTKit.h>
@implementation testProjAppDelegate

@synthesize window;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    QTMovie* movie = [QTMovie movieWithFile:@"/Users/Morgan/Desktop/sample_iTunes.mov" error:nil];

    if (movie)
    {
        [movie setDelegate:self];

        NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], QTMovieExport, 
                              [NSNumber numberWithInt:kQTFileType3GPP], QTMovieExportType, nil];


        [movie writeToFile:@"/Users/Morgan/Desktop/test.mp4" withAttributes:dict error:nil];

        NSLog(@"DONE");
    }
}

- (BOOL)movie:(QTMovie *)movie shouldContinueOperation:(NSString *)op withPhase:(QTMovieOperationPhase)phase atPercent:(NSNumber *)percent withAttributes:(NSDictionary *)attributes
{
    NSLog(@"PROGRESS");
    return YES; 
}

@end

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只是在用心讲痛 2024-10-28 08:05:38

这似乎不起作用,因为我的应用程序是为 64 位编译的。我假设这是 QTKit 框架中的一个错误?我发现其他一些提到 QTMovie 代表无法在 64 位应用程序中工作的内容。我可以编译 32 位应用程序,但这不是问题。不过,这应该可以在 64 位上运行,不是吗?

It appears that this is not working because my app was compiled for 64 bit. I'm assuming this is a bug in the QTKit framework? I found a few other mentions of QTMovie delegates not working in 64 bit applications. I can compile my app for 32 bit though which isn't a problem. Still, this should work in 64 bit, shouldn't it?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文