We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-湛蓝_大神你好! 我这边在使用 PKPlayerView 不能播放短视频;具体代码如下:
录制视频: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *fileName = [NSProcessInfo processInfo].globallyUniqueString; NSString *path = [paths[0] stringByAppendingPathComponent:[fileName stringByAppendingPathExtension:@"mp4"]]; //跳转默认录制视频ViewController PKRecordShortVideoViewController *viewController = [[PKRecordShortVideoViewController alloc] initWithOutputFilePath:path outputSize:CGSizeMake(320, 240) themeColor:[UIColor colorWithRed:0/255.0 green:153/255.0 blue:255/255.0 alpha:1]]; //通过代理回调 viewController.delegate = self; [self presentViewController:viewController animated:YES completion:nil]; 播放视频:
(void)didFinishRecordingToOutputFilePath:(NSString *)outputFilePath{ _outputFilePath = outputFilePath; _playerView = [[PKPlayerView alloc] initWithFrame:CGRectMake(30, 30, kScreenWidth - 60, 200) videoPath:_outputFilePath previewImage:[UIImage pk_previewImageWithVideoURL:[NSURL fileURLWithPath:_outputFilePath]]]; [self.view addSubview:_playerView];
UITapGestureRecognizer *tapp = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(playViewAction)]; [_playerView addGestureRecognizer:tapp]; }
(void)playViewAction{ //跳转全屏播放小视频界面 [_playerView play]; }
谢谢!
The text was updated successfully, but these errors were encountered:
呃,你这样说和贴代码并没有什么用,你下载demo后可以录制和播放视频吗 @erduoniba
Sorry, something went wrong.
下载你的demo后是可以播放的。然后我这边其实和demo的代码也一致。
@erduoniba 那就是在你的项目中用不了吗,那你确认以下权限相关问题?
目前测试iOS10.0.1短视频不能播放,其他系统版本可以,相同代码
No branches or pull requests
-湛蓝_大神你好!
我这边在使用 PKPlayerView 不能播放短视频;具体代码如下:
录制视频:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *fileName = [NSProcessInfo processInfo].globallyUniqueString;
NSString *path = [paths[0] stringByAppendingPathComponent:[fileName stringByAppendingPathExtension:@"mp4"]];
//跳转默认录制视频ViewController
PKRecordShortVideoViewController *viewController = [[PKRecordShortVideoViewController alloc] initWithOutputFilePath:path outputSize:CGSizeMake(320, 240) themeColor:[UIColor colorWithRed:0/255.0 green:153/255.0 blue:255/255.0 alpha:1]];
//通过代理回调
viewController.delegate = self;
[self presentViewController:viewController animated:YES completion:nil];
播放视频:
(void)didFinishRecordingToOutputFilePath:(NSString *)outputFilePath{
_outputFilePath = outputFilePath;
_playerView = [[PKPlayerView alloc] initWithFrame:CGRectMake(30, 30, kScreenWidth - 60, 200)
videoPath:_outputFilePath
previewImage:[UIImage pk_previewImageWithVideoURL:[NSURL fileURLWithPath:_outputFilePath]]];
[self.view addSubview:_playerView];
UITapGestureRecognizer *tapp = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(playViewAction)];
[_playerView addGestureRecognizer:tapp];
}
(void)playViewAction{
//跳转全屏播放小视频界面
[_playerView play];
}
谢谢!
The text was updated successfully, but these errors were encountered: