StreamServer

public protocol StreamServer : Peripheral

StreamServer peripheral interface. This peripheral allows streaming of live camera video and replay of video files stored in drone memory.

This peripheral can be retrieved by:

drone.getPeripheral(Peripherals.streamServer)
  • Tells whether streaming is enabled.

    When streaming gets enabled, currently suspended stream will be resumed. When streaming is enabled, streams can be started.

    When streaming gets disabled, currently started stream gets suspended, in case it supports suspended state (CameraLive), or stopped otherwise (MediaReplay). When streaming is disabled, no stream can be started.

    Declaration

    Swift

    var enabled: Bool { get set }
  • Provides access to the drone camera live stream. There is only one live stream instance that is shared amongst all open references. Dereferencing the returned reference does NOT automatically stops the referenced camera live stream.

    Declaration

    Swift

    func live(observer: @escaping (_ stream: CameraLive?) -> Void) -> Ref<CameraLive>

    Parameters

    observer

    notified when the stream state changes

    Return Value

    a reference to the camera live stream interface

  • Provides access to the drone camera live stream. There is only one live stream instance that is shared amongst all open references. Dereferencing the returned reference does NOT automatically stops the referenced camera live stream.

    Declaration

    Swift

    func live(source: CameraLiveSource, observer: @escaping (_ stream: CameraLive?) -> Void) -> Ref<CameraLive>

    Parameters

    source

    live source to stream

    observer

    notified when the stream state changes

    Return Value

    a reference to the camera live stream interface

  • Creates a new replay stream for a media resource. Every successful call to this method creates a new replay stream instance for the given media resource, that must be disposed by dereferencing the returned reference once that stream is not needed. Dereferencing the returned reference automatically stops the referenced media replay stream.

    Declaration

    Swift

    func replay(source: MediaReplaySource, observer: @escaping (_ stream: MediaReplay?) -> Void) -> Ref<MediaReplay>?

    Parameters

    source

    media source to stream

    observer

    notified when the stream state changes

    Return Value

    a reference to the replay stream interface, or ‘nil’ in case the provided resource cannot be streamed