得到了在tableView中显示的数组的索引。需要在didSelectRowAtIndexpath
中播放。
MPMediaItem *item = [arrAnand objectAtIndex:3];
NSURL *url = [item valueForProperty:MPMediaItemPropertyAssetURL];
AVPlayerItem *playerItem = [[AVPlayerItem alloc] initWithURL:url];
player2 = [[AVPlayer alloc] initWithPlayerItem:playerItem];
[player2 play];
需要让index匹配当前选择的应该怎么做?
谢谢