RVS_MediaServer_ServerViewController

This is the view controller for the main server status window.

  • The size of time slices in the HLS output. ffmpeg defaults to 2. Apple recommends 6.

    Declaration

    Swift

    private static let _hlsTimeSliceInSeconds: Int
  • The number of seconds to wait between page refreshes, while waiting to load.

    Declaration

    Swift

    private static let _pageReloadDelayInSeconds: Float
  • The name of our temporary stream file (for HTTP server).

    Declaration

    Swift

    private static let _streamFileName: String
  • The Server Status Segmented Switch

    Declaration

    Swift

    @IBOutlet
    weak var serverStateSegmentedSwitch: NSSegmentedControl!
  • This button displays a link to allow the server to be easily opened.

    Declaration

    Swift

    @IBOutlet
    weak var linkButton: NSButton!
  • This is the scroller that contains the console display.

    Declaration

    Swift

    @IBOutlet
    weak var consoleDisplayScrollView: NSScrollView!
  • This is the actual console text display within that scroller.

    Declaration

    Swift

    @IBOutlet
    var consoleDisplayTextView: NSTextView!
  • This is the disclosure tirangle for the console display.

    Declaration

    Swift

    @IBOutlet
    weak var showConsoleDisclosure: NSButton!
  • This button holds the text for the disclosure, and toggles it.

    Declaration

    Swift

    @IBOutlet
    weak var showConsoleToggleButton: NSButton!
  • Set up the various localized items and initial values.

    Declaration

    Swift

    func setUpLocalizations()
  • Starts both (or just the ffmpeg) server[s], and refreshes the UI.

    Declaration

    Swift

    func startServers()
  • Stops any running servers, and refreshes the UI.

    Declaration

    Swift

    func stopServers()
  • This starts or stops the streaming server, depending on the state of the server.

    Declaration

    Swift

    @IBAction
    func startStopButtonHit(_ inSender: NSSegmentedControl)

    Parameters

    inSender

    Ignored

  • This responds to the server link button being hit. Assuming the server is running, this will ask the default browser to open the link.

    Declaration

    Swift

    @IBAction
    func linkButtonHit(_ inSender: NSButton)

    Parameters

    inSender

    The Link button. We will use its text value as our URI source.

  • This is called when the disclosure toggle button is hit.

    Declaration

    Swift

    @IBAction
    func showConsoleToggleButtonHit(_ sender: Any)
  • The Web Server Running Status. If set to true, then the server will start, using whatever handler is already in webServerHandler

    Declaration

    Swift

    @objc
    dynamic var isRunning: Bool { get set }
  • This is an observer callback that handles changes in the prefs server running status.

    Declaration

    Swift

    func serverStatusObserverHandler(_: RVS_MediaServer_ServerViewController! = nil, _: NSKeyValueObservedChange<Bool>! = nil)
  • Called when the view finishes loading.

    Declaration

    Swift

    override func viewDidLoad()
  • Called when the view is about to disappear. We make sure that we stop our server and the ffmpeg process.

    Declaration

    Swift

    override func viewWillDisappear()
  • Called by the app delegate to ask registrants to re-up their UI.

    Declaration

    Swift

    override func updateUI()