AVPlayerViewController在模拟器上失败,在实际设备上运行

时间:2018-06-21 03:35:58

标签: ios ios-simulator avplayerviewcontroller avkit

以下代码创建一个AVPlayerViewController,但是11.4模拟器上缺少该视图。在模拟器上,最后一个命令获取UIKit`UIViewAlertForUnsatisfiableConstraints:

在我的iPad(9.3)上,它可以正常运行并显示视频。

    AVPlayerItem * playerItem= [AVPlayerItem playerItemWithURL:[NSURL  
             URLWithString:model.currentCamera.videoUrl]];
    model.playerViewController = AVPlayerViewController.new;
    model.playerViewController.player = [AVPlayer playerWithPlayerItem:playerItem];
    UIView *xy = model.playerViewController.view;

这是UIViewAlertForUnsatisfiableConstraints的显示内容

    UIWindow:0x7fb19ce1a780
|   UIView:0x7fb19cf0c270
|   |   NavBar:0x7fb19ce03c60
|   |   |   UIButton:0x7fb19cf05830
|   |   |   |   UIImageView:0x7fb19cf06670
|   |   |   UIButton:0x7fb19cd135d0
|   |   |   |   UIImageView:0x7fb19cd13d10
|   |   |   UILabel:0x7fb19cd13f40'Current route name'
|   |   |   UIView:0x7fb19cd16740
|   |   |   UIButton:0x7fb19cd16930'Main View'
|   |   |   |   UIButtonLabel:0x7fb19cd16df0'Main View'
|   |   |   UIButton:0x7fb19cd14220'List View'
|   |   |   |   UIButtonLabel:0x7fb19cd14540'List View'
|   |   |   UIButton:0x7fb19cd17ab0'Map View'
|   |   |   |   UIButtonLabel:0x7fb19cd17dd0'Map View'
|   |   |   UIButton:0x7fb19cd180d0'Traffic Radio'
|   |   |   |   UIButtonLabel:0x7fb19cd183f0'Traffic Radio'
|   |   |   UIButton:0x7fb19cd186f0'Report'
|   |   |   |   UIButtonLabel:0x7fb19cd18a10'Report'
|   |   |   UIView:0x7fb19cd18d10
|   |   TabBar1:0x7fb19cd18f00
|   |   |   UIView:0x7fb19cd19350
|   |   |   UIImageView:0x7fb19cd19540
|   |   |   UILabel:0x7fb19cd1b7a0'Home'
|   |   |   UIImageView:0x7fb19cd1be30
|   |   |   UILabel:0x7fb19cd1d5e0'Cameras'
|   |   |   UIImageView:0x7fb19cd1da70
|   |   |   UILabel:0x7fb19cd1f220'Route'
|   |   |   UIImageView:0x7fb19cd1f6b0
|   |   |   UILabel:0x7fb19cd20e60'More'
|   |   UILabel:0x7fb19cf10c20'
To be filled in.  This s...'
|   |   ViewOneCamera:0x7fb19cf27900
|   |   |   UIImageView:0x7fb19cf32830
|   |   |   UIButton:0x7fb19cf32fe0
|   |   |   |   UIImageView:0x7fb19cf33300
|   |   |   UIButton:0x7fb19cf33530'Pause'
|   |   |   |   UIButtonLabel:0x7fb19cf33850'Pause'

0 个答案:

没有答案