I have a UITableView
containing a number of videos to play when scrolling. As the cells in the tableView are being re-used, I only instantiate one AVPlaye
You should profile your app using the time profiler to see where the lagging is actually occurring.
The documentation for replaceCurrentItemWithPlayerItem:
clearly states that it executes asynchronously, so it shouldn't be the source of your main queue jumpiness.
The item replacement occurs asynchronously; observe the currentItem property to find out when the replacement will/did occur.
Documentation here
If you still can't figure it out, post more code, and in particular at least your cellForRowAtIndexPath
method.
UPDATE
As per @joey's comment below, the previous content of this answer is no longer valid. The documentation no longer states that the method is asynchronous, so it may not be.