SKVideoNode奇怪的日志错误

时间:2016-04-04 02:59:45

标签: objective-c macos sprite-kit skvideonode

我按以下方式创建SKVideoNode。它创建视频没有任何问题,但我得到这个奇怪的日志消息,我想知道是否有人知道它是什么。我试过谷歌搜索,但我找不到任何东西。

这里出现错误:
[22:48:15.170] vtFindDynamicSession signalled err=-11204 (err) (registered pixel transfer service failed to open; falling back) at /SourceCache/CoreMedia_frameworks/CoreMedia-1562.240/Sources/VideoToolbox/VTPixelTransferSession.c line 6878

GameScene.m

#import "GameScene.h"
#import <AVFoundation/AVFoundation.h>

@interface GameScene()

@property SKVideoNode *vid;
@property AVPlayer *avPlayer;

@end

@implementation GameScene

-(void)didMoveToView:(SKView *)view {
    NSString *fileName = @"QSeanRay";
    NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDesktopDirectory, NSUserDomainMask, YES);
    NSString *desktopPath = [paths objectAtIndex:0];
    NSString *resourcePath = [NSString stringWithFormat:@"%@/vs", desktopPath];
    NSString *videoPath = [NSString stringWithFormat:@"%@/%@.mp4", resourcePath, fileName];
    NSURL *fileURL = [NSURL fileURLWithPath:videoPath];
    AVPlayer *avPlayer = [[AVPlayer alloc] initWithURL:fileURL];

    _vid = [SKVideoNode videoNodeWithAVPlayer:avPlayer];
    _vid.position = CGPointMake(view.bounds.size.width/2, view.bounds.size.height/2);
    [_vid setScale:0.4];
    [self addChild:_vid];
    [_vid play];

    avPlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone;

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(playerItemDidReachEnd:)
                                                 name:AVPlayerItemDidPlayToEndTimeNotification
                                               object:[avPlayer currentItem]];
}

- (void)playerItemDidReachEnd:(NSNotification *)notification {
    AVPlayerItem *p = [notification object];
    [p seekToTime:kCMTimeZero];
}


@end

0 个答案:

没有答案