Search code examples
iosswiftuitableviewmpmovieplayercontroller

MPMovieplayer now playing issue iOS


I have one view control that consists of MP Movie Player control. This control loads video from url. It loads the video perfectly. When I move to the previous control which has TableView, the audio of the video is played in background prefectly. The control which has a TableView consists of 'Now Playing' button. On pressing of 'Now Playing' the user is moved back to MP Movie Player control. But the problem persist here is that the video is loaded again where it was instead of continuous playing.


Solution

  • You need to get the current position of the movie from the property currentPlaybackTime while on your TableView. Then when you move to the MP Movie Player control, you need to specify the currentPlaybackTime you had used in the TableView.