Open Fuhanyu opened 8 years ago
2016-08-24 11:22:31.628 MD360PlayerDemo[6703:2724679] Received memory warning.
(void)viewDidLoad { [super viewDidLoad]; // Create a AVPlayerItem AVPlayerItem playerItem = [[AVPlayerItem alloc] initWithURL:[NSURL URLWithString:@"http://d8d913s460fub.cloudfront.net/krpanocloud/video/airpano/video-1920x960a.mp4"]]; self.player = [[AVPlayer alloc] initWithPlayerItem:playerItem]; [self.player play]; AVPlayerLayer playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player]; [playerLayer setFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.width * 9 / 16)]; [self.view.layer addSublayer:playerLayer];
/////////////////////////////////////////////////////// MDVRLibrary MDVRConfiguration* config = [MDVRLibrary createConfig];
[config asVideo:playerItem]; [config setContainer:self view:self.view];
// optional [config displayMode:MDModeDisplayNormal]; [config interactiveMode:MDModeInteractiveMotionWithTouch]; [config projectionMode:MDModeProjectionSphere]; [config pinchEnabled:true]; [config setDirectorFactory:self];
self.vrLibrary = [config build]; }
麻烦提供下版本号,谢谢
pod 'MD360Player4iOS', '~> 1.1.3.beta' 这个版本的,连接真机提示。
你是通过pod方式引入的,还是直接下载的master代码?
自己的Demo是使用pod引入的。 还有po主我使用AVPlayer来播放无效果啊,是只有使用VIMPlayer才好用么?谢谢了
一样的,VIMPlayer封装了AVPlayer
好的 我自己在研究下。
2016-08-24 11:22:31.628 MD360PlayerDemo[6703:2724679] Received memory warning.
(void)viewDidLoad { [super viewDidLoad]; // Create a AVPlayerItem AVPlayerItem playerItem = [[AVPlayerItem alloc] initWithURL:[NSURL URLWithString:@"http://d8d913s460fub.cloudfront.net/krpanocloud/video/airpano/video-1920x960a.mp4"]]; self.player = [[AVPlayer alloc] initWithPlayerItem:playerItem]; [self.player play]; AVPlayerLayer playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player]; [playerLayer setFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.width * 9 / 16)]; [self.view.layer addSublayer:playerLayer];
/////////////////////////////////////////////////////// MDVRLibrary MDVRConfiguration* config = [MDVRLibrary createConfig];
[config asVideo:playerItem]; [config setContainer:self view:self.view];
// optional [config displayMode:MDModeDisplayNormal]; [config interactiveMode:MDModeInteractiveMotionWithTouch]; [config projectionMode:MDModeProjectionSphere]; [config pinchEnabled:true]; [config setDirectorFactory:self];
self.vrLibrary = [config build]; }