SJVideoPlayer 不播放视频显示黑屏

SJVideoPlayer Not Playing video Display black screen

我只是使用下面的代码,但它显示黑屏。

SJVideoPlayer *videoPlayer = [SJVideoPlayer player];
videoPlayer.view.frame = CGRectMake(0, 20, 200, 200 * 9/16.0);
[self.view addSubview:videoPlayer.view];
videoPlayer.URLAsset = [[SJVideoPlayerURLAsset alloc] initWithURL:[NSURL URLWithString:@"http://yxfile.idealsee.com/9f6f64aca98f90b91d260555d3b41b97_mp4.mp4"]];
[videoPlayer play];

在日志中显示如下输出:-

SJBaseVideoPlayer<0x111dc82d0>.SJVideoPlayerPlayStatus.Prepare
VideoPlayerDemo[1093:534379] CredStore - performQuery - Error copying matching creds. Error=-25300, query={
class = inet;
"m_Limit" = "m_LimitAll";
"r_Attributes" = 1;
sync = syna;
}

VideoPlayerDemo[1093:534344] 91 - -[SJVideoPlayer dealloc]
VideoPlayerDemo[1093:534344] 58 - -[SJAVMediaPlaybackController dealloc]
VideoPlayerDemo[1093:534344] 42 - -[SJAVMediaPlayAsset dealloc]

发布了,你应该有很强的参考性。

@interface YourViewController : UIViewController
// strong reference
@property (nonatomic, strong) SJVideoPlayer *videoPlayer;
@end

@implementation YourViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _videoPlayer = [SJVideoPlayer player];
    _videoPlayer.view.frame = CGRectMake(0, 20, 200, 200 * 9/16.0);
    [self.view addSubview:_videoPlayer.view];
    _videoPlayer.URLAsset = [[SJVideoPlayerURLAsset alloc] initWithURL:[NSURL URLWithString:@"http://yxfile.idealsee.com/9f6f64aca98f90b91d260555d3b41b97_mp4.mp4"]];
    [_videoPlayer play];
}

@end