Writing an app to stream video to iPhone

后端 未结 6 752
北海茫月
北海茫月 2020-12-04 10:25

I\'m interested in creating an iPhone app that can stream video from a central server, YouTube style. I was wondering if anyone has ever tried to do this before, what is the

6条回答
  •  执念已碎
    2020-12-04 11:14

    2018 answer You can use AVPlayerViewController since MPMoviePlayerController is deprecated since iOS 9

        NSURL *url = [NSURL URLWithString:videoUrl];
    
        _playerViewController = [[AVPlayerViewController alloc] init];
        _playerViewController.player = [AVPlayer playerWithURL:url];
        _playerViewController.player.volume = 1;
        _playerViewController.showsPlaybackControls = YES;
    
        _playerViewController.view.frame = CGRectMake(....);
        [self.view addSubview:_playerViewController.view];
    

提交回复
热议问题