Contents

ImmersiveMediaRemotePreviewSender

An observable object that helps an app send the required data to all connected receiver applications to help facilitate the complete preview of the immersive media playback.

Declaration

class ImmersiveMediaRemotePreviewSender

Overview

Applications have to implement the protocol ImmersiveMediaPreviewMessagingProtocol so that messages exchanged between sender and receivers are in the correct format for processing. Applications need to provide this as custom protocol when establishing the network connection between the sender and the receivers.

It’s also important to configure the NWParameters to be secure by adding TLS security options as the example below.

func setupNWParameters() -> NWParameters {
    let tcpOptions = NWProtocolTCP.Options()
    let tls = /* setup TLS security options */

    let ret = NWParameters(tls: tls, tcp: tcpOptions)

    let options = NWProtocolFramer.Options(definition: ImmersiveMediaPreviewMessagingProtocol.definition)
    ret.defaultProtocolStack.applicationProtocols.insert(options, at: 0)

    return ret
}
let parameters = setupNWParameters()
let browser = NWBrowser(for: .bonjour(type: serviceType, domain: nil), using: parameters)
let parameters = setupNWParameters()
let listener = try NWListener(using: parameters)

Topics

Initializers

Instance Properties

Instance Methods

See Also

Preview