search

Home  >  Q&A  >  body text

ios - AVPlayerViewController播放.mp4问题

问题:使用AVPlayerViewController 播放远程视频(.mp4格式)出现下图情况

AVPlayerViewController *videoVC = [[AVPlayerViewController alloc] init];
    videoVC.player = [[AVPlayer alloc] initWithURL:[NSURL URLWithString:urlString]];
    [videoVC.player play];
    [self presentViewController:videoVC animated:YES completion:nil];

补充:新建了一个项目 修改代码(俩种方式任选其一都是可以在模拟器上播放的) 但是在真机中还是不能播放

PHP中文网PHP中文网2809 days ago635

reply all(1)I'll reply

  • 阿神

    阿神2017-04-18 09:52:19

    Solved, because the audio format of the video recorded by the company's Android is AMR_NB, so Android changed the audio format to AAC format, and it can be played normally using AVPlayerViewController!

    reply
    0
  • Cancelreply