RVS_MediaServer_ServerViewController
class RVS_MediaServer_ServerViewController : RVS_MediaServer_BaseViewController, RVS_MediaServer_FFMPEGServerManagerDelegate, RVS_MediaServer_HTTPServerManagerDelegate
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
-
This is the FFMPEG server handler view model. Most of the work goes on in that class.
Declaration
Swift
private var _ffmpegServerHandler: RVS_MediaServer_FFMPEGServerManager!
-
This is the HTTP server handler view model.
Declaration
Swift
private var _httpServerManager: RVS_MediaServer_HTTPServerManager!
-
This will hold the url of our output streaming file.
Declaration
Swift
private var _outputTmpFile: TemporaryFile!
-
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 to indicate that a running process, is running no more.
Declaration
Swift
func mediaServerManager(_ inManager: RVS_MediaServer_FFMPEGServerManager, taskStopped inTask: Process!)
Parameters
inManager
The manager object
task
The process that is no longer running.
-
Called to deliver text intercepted from ffmpeg.
This is called on the main thread.
Declaration
Swift
func mediaServerManager(_ inManager: RVS_MediaServer_FFMPEGServerManager, task: Process!, ffmpegConsoleTextReceived inTextReceived: String)
Parameters
inManager
The manager object
task
The process running.
ffmpegConsoleTextReceived
The text received.
-
Called if there was an error encountered.
Declaration
Swift
func mediaServerManager(_: RVS_MediaServer_FFMPEGServerManager, task inTask: Process!, ffmpegError inError: String)
Parameters
task
The process running.
ffmpegError
The text received.
-
Called if there was an error encountered.
Declaration
Swift
func mediaServerManager(_: RVS_MediaServer_HTTPServerManagerDelegate, httpError inError: String)
Parameters
httpError
The text received.
-
Called by the app delegate to ask registrants to re-up their UI.
Declaration
Swift
override func updateUI()