Ios AVPlayerViewController播放Mp3等音乐的代理方法是什么
我想在显示以下图片的所有按钮上添加操作。我通过..添加此视图。。以下代码--Ios AVPlayerViewController播放Mp3等音乐的代理方法是什么,ios,objective-c,iphone,Ios,Objective C,Iphone,我想在显示以下图片的所有按钮上添加操作。我通过..添加此视图。。以下代码-- 因此,请帮助我添加此按钮上的操作是。。。。。我解决这些问题。。。正确的代码是-- 在avplayervcontroller的avplayervlayer*player属性上使用KVO。 AVPlayerViewController *playerViewController = [[AVPlayerViewController alloc] init]; playerViewController.view.fram
因此,请帮助我添加此按钮上的操作是。。。。。我解决这些问题。。。正确的代码是--
在
avplayervcontroller
的avplayervlayer*player
属性上使用KVO。
AVPlayerViewController *playerViewController = [[AVPlayerViewController alloc] init];
playerViewController.view.frame = CGRectMake(10,10, _bgView.frame.size.width-20, _bgView.frame.size.height-20);
playerViewController.player = [AVPlayer playerWithURL:url1];
[_bgView addSubview:playerViewController.view];
_bgView.autoresizesSubviews = TRUE;
_playerViewController = [[AVPlayerViewController alloc] init];
_playerViewController.view.frame=CGRectMake(10,10, _bgView.frame.size.width-20, _bgView.frame.size.height-20);
_playerViewController.player = [AVPlayer playerWithURL:url1];