Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios AVPlayerViewController播放Mp3等音乐的代理方法是什么_Ios_Objective C_Iphone - Fatal编程技术网

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];