Skip to content

How to Start Using the Watcher SDK

To start using Flussonic Watcher SDK for iOS, attach it to your project as CocoaPods dependency. Please refer to readme file for instructions.

After you've done it, your project will receive the necessary classes and protocols, such as FlussonicWatcherView and FlussonicPlayerAdapterProtocol; PreviewMp4View and PreviewMp4ViewStatusListener.

To embed the component into your app, you can use the .xib(.storyboard) layout, or do it in your executable code.

The FlussonicWatcherView component

You need to configure FlussonicWatcherView by specifying a camera object (or the URL of video stream) and an adapter object.

The adapter object must execute the protocol FlussonicPlayerAdapterProtocol and provide a drawable – UIView, to which the picture from a camera will be passed.

For rendering you can use any player, for example, VLC Media Player. This adapter can be used to pass events from the player via the protocol FlussonicPlayerAdapterDelegate.

For getting the state of the player FlussonicWatcherView use delegates of the following protocols:

  • FlussonicBufferingListener – it monitors the state of buffering;
  • FlussonicDownloadRequestListener – it notifies when the downloading of a next video chunk begins.
  • FlussonicWatcherDelegateProtocol – it notifies about toolbar appearance;
  • FlussonicUpdateProgressEventListener – it notifies about changing of palyback parameters.

The PreviewMp4View component

You can configure PreviewMp4View in either of the ways: using URLComponents, the object CameraItem, or URL.

You must also specify the key cacheKey for caching the image (screenshot).

To track the status of image downloading, you can use the protocol PreviewMp4ViewStatusListener.