1

我正在通过以下方式创建一个 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

游戏场景.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
4

0 回答 0