- (void)playMethod {
NSURL *url = [[NSURL alloc] initWithString:@"rtmp://54.206.31.70:1935/CVIEW_alpha/24"];
player = [AVPlayer playerWithURL:url];
controller = [[AVPlayerViewController alloc] init];
[self addChildViewController:controller];
[self.view addSubview:controller.view];
//to rotate to the landscape on click of play button
[[UIDevice currentDevice] setValue:@(UIInterfaceOrientationLandscapeLeft) forKey:@"orientation"];
[UINavigationController attemptRotationToDeviceOrientation];
//to open the view
controller.view.frame = CGRectMake(0,0,667,375);
controller.player = player;
controller.showsPlaybackControls = YES;
// to add the back button on player
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
[button1 addTarget:self
action:@selector(backMethod)
forControlEvents:UIControlEventTouchUpInside];
[button1 setTitle:@"Back" forState:UIControlStateNormal];
[button1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
button1.frame = CGRectMake(50.0, CGRectGetMinY(controller.view.frame)+10, 160.0, 40.0);
button1.tag = 1001;
[self.view addSubview:button1];
[controller.view bringSubviewToFront:button1];
[player pause];
[player play];
}
Я пытаюсь воспроизвести указанный выше URL в AVPlayer и получаю следующие ошибки.
2018-06-08 14: 55: 00.326842 + 0530 vedio [14773: 4486922] NSURLConnectionзакончил с ошибкой - код -1002 2018-06-08 14: Vedio [14773: 4485935] 00,605227 + 0530: [] <<<< AVOutputDeviceDiscoverySession (FigRouteDiscoverer) >>>> - [AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl outputDeviceDiscoverySessionDidChangeDiscoveryMode]: 55 режим обнаружения Настройка устройствачтобы DiscoveryMode_None (клиент: Vedio) 2018-06-08 14: 55: 00,652598 + 0530 Vedio [14773: 4485935] [] <<<< AVOutputDeviceDiscoverySession (FigRouteDiscoverer) >>>> - [AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl outputDeviceDiscoverySessionDidChangeDiscoveryMode:]: режим обнаружения Настройка устройстваto DiscoveryMode_Presence (client: vedio) 2018-06-08 14: 55: 01.013628 + 0530 vedio [14773: 4485935] [App], если мы находимся в реальном обработчике предварительной фиксации, мы не можем фактически добавить какие-либо новые заборы из-заCA ограничение 2018-06-08 14: 55: 01.013766 + 0530 vedio [14773: 4485935] [App], если мы находимся в реальном обработчике предварительной фиксации, мы не можем добавить какие-либо новые заборы из-за ограничения CA