Initializing the Components
The FlussonicWatcherView component
FlussonicWatcherView start playing video, you need to call two methods:
- one of the
setUrl(@NonNull String url).
The order of calling of these methods is not important.
Certain parameters must be passed to
initialize(). Depending on how you use
FlussonicWatcherView, the following variants are possible:
- Activity and the boolen sign that indicates that you use this SDK in React Native (this method is used in the React Native module of Flussonic Watcher SDK).
In Java code you need to call the setter
setUrl(). In React Native you need to specify the
url parameter when initializing the component in the layout.
The FlussonicThumbnailView component
In order for
FlussonicThumbnailView to start loading a video frame, you need to call the method
setUrl(@NonNull String url)
show(@NonNull Camera camera, @Nullable Date date).
In the first case, the parameters used for loading an MP4 frame will be generated using the passed URL string (see later on this page).
In the second case, the component will first try to get the streamer connection parameters, and then generate an MP4-frame loading parameters by using the received streamer parameters.
The URL format
The passed URL must be in the following notation:
<token>— the token obtained through the
logincall (the part <token>@ is allowed to be missing).
<server>— the name of the Watcher server to which you need to send the call
<port>— the port on the server (the part :<port> is allowed to be missing)
<stream>— the camera name
<query>— query string (?<query> is allowed to be missing). When the URL is parsed out, in
<query>the substring from=<number> is sought for, and the
<number>is understood as
startPosition(see the method setStartPosition).
In Java code the standard URL parser is used, and also additional checks, so you can pass many different variants of the URL — the parameters that are obtained after parsing will be the same for many variants of URL notation.
Suppose the following URL was passsed:
The SDK performs the call to Watcher
and obtains the parameters for connecting to a streamer.
FlussonicWatcherView you make the following calls to
- to get the beginning and ending of the DVR recording:
- to get recorded ranges (intervals) of the DVR recording: