无法在ios上的局域网上播放视频

时间:2018-03-19 08:31:19

标签: ios objective-c avplayer mpmovieplayercontroller avplayerviewcontroller

我可以通过网络在网络上播放视频,但不能通过局域网,我的代码如下。

- (IBAction)playAction:(id)sender {
    // cant play
    //self.url = [NSURL URLWithString:@"https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"];   
    // cant play
    self.url = [NSURL URLWithString:@"http://192.168.43.1:6080/?methodType=download&path=/Download/hi.mp4"]; 
    AVPlayer *player = [AVPlayer playerWithURL:self.url];
    AVPlayerViewController *playerVC = [[AVPlayerViewController alloc] init];
    playerVC.player = player;
    playerVC.view.frame = self.view.frame;
    [self.view addSubview:playerVC.view];
    self.playerVC = playerVC;
    [self.playerVC.player play];
}

0 个答案:

没有答案