MjpegStream

@available(*, deprecated, message: "This does not work on Skyle 3")
public class MjpegStream : NSObject, URLSessionDelegate, URLSessionDataDelegate, ObservableObject

MjpegStream serves the video stream of Skyle.

  • Empty initilizer

    Declaration

    Swift

    public override init()
  • Enum describing MjpegError

    See more

    Declaration

    Swift

    internal enum MjpegStreamError : Error
  • The image property exposes a Publisher which holds the current stream image. This is updated whenever a new image is available.

  • The cgimage property exposes a Publisher which holds the current stream image. This is updated whenever a new image is available.

    Declaration

    Swift

    @Published
    public var cgimage: CGImage? { get set }
  • The state property exposes a Publisher which indicates the state of the stream of gaze data.

    Declaration

    Swift

    @Published
    private(set) public var state: States { get set }
  • This function is called when a retry occurs. continue needs to be called to actually continue with the retry. This is reset after each successful connection. Please set this before calling start()

    Declaration

    Swift

    public var doBeforeRetry: ((_ continue: @escaping () -> Void) -> Void)?
  • Starts a video stream by calling on the provided URL.

    • url: A URL pointing to the streams origin.
    • retries: Maximum of retries.

    Declaration

    Swift

    public func start(_ url: URL = URL(string: "http://skyle.local:8080/?action=stream")!)
  • Stops the video stream and updating state.

    Declaration

    Swift

    public func stop()

Session Delegates