[iOS, Swift] MediaPlayer - how to pause/rewind video? Caching?

Is there a option to pause/rewind streamed video? Does the user have to download every time they want to play it?

Miroslav, you should investigate our VideoService sample: clone our iOS-Samples github repo & load SwiftSamples.xcworkspace.

This sample demonstrate live/record stream publish, live/vod stream play, ‘stream pause/resume’ and ‘switch cameras’ actions (‘rewind’ in not supported’).

I’ve investigated VideoService and there is only “Playback” and “Stop”. I don’t see any pause. Neither does it answer my question about the caching. It looks like the video is being downloaded every time.

I have found that there is VideoService also in the obj-c project and there is pause resume, but it doesn’t work. Here are the issues:

    When I pause and resume the recording and try to play it back, I'm losing the video after the first cut. I can go without it for now, but it's a major bug. When I'm streaming and watching the video and hit pause, I no longer see the video When I'm streaming and watching the video and hit pause, I still hear the sound When I'm streaming and watching the video and hit pause and resume, I'm getting this error:
NetStream.Play.StreamNotFound

How can I get it working?

‘rewind’ in not supported’ -> I assume there is no way I could cache the video on the device for offline playback, right?

I found a workaround solution of this problem:

  1. record a file
  2. upload to the fileService
  3. download and display with AVPlayer

There is a tutorial:

and a MIT licence library: