Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
iOS Documentation
SDLStreamingMediaConfiguration

SDLStreamingMediaConfiguration Class Reference

Section Contents

Overview

The streaming media configuration. Use this class to configure streaming media information.

maximumDesiredEncryption

What encryption level video/audio streaming should be. The default is SDLStreamingEncryptionFlagAuthenticateAndEncrypt.

Objective-C

@property (nonatomic) SDLStreamingEncryptionFlag maximumDesiredEncryption;

Swift

var maximumDesiredEncryption: SDLStreamingEncryptionFlag { get set }

customVideoEncoderSettings

Properties to use for applications that utilize the video encoder for streaming. See VTCompressionProperties.h for more details. For example, you can set kVTCompressionPropertyKey_ExpectedFrameRate to set your framerate. Setting the framerate this way will also set the framerate if you use CarWindow automatic streaming.

Other properties you may want to try adjusting include kVTCompressionPropertyKey_AverageBitRate and kVTCompressionPropertyKey_DataRateLimits.

Objective-C

@property (nonatomic, copy, nullable) NSDictionary<NSString *, id> *customVideoEncoderSettings;

Swift

var customVideoEncoderSettings: [String : Any]? { get set }

dataSource

Usable to change run time video stream setup behavior. Only use this and modify the results if you really know what you’re doing. The head unit defaults are generally good.

Objective-C

@property (nonatomic, weak, nullable) id<SDLStreamingMediaManagerDataSource> dataSource;

rootViewController

Set the initial view controller your video streaming content is within.

Activates the haptic view parser and CarWindow systems when set. This library will also use that information to attempt to return the touched view to you in SDLTouchManagerDelegate.

Note

If you wish to alter this rootViewController while streaming via CarWindow, you must set a new rootViewController on SDLStreamingMediaManager and this will update both the haptic view parser and CarWindow.

Warning

Apps using views outside of the UIView hierarchy (such as OpenGL) are currently unsupported. If you app uses partial views in the hierarchy, only those views will be discovered. Your OpenGL views will not be discoverable to a haptic interface head unit and you will have to manually make these views discoverable via the SDLSendHapticData RPC request.

Warning

If the rootViewController is app UI and is set from the UIViewController class, it should only be set after viewDidAppear:animated is called. Setting the rootViewController in viewDidLoad or viewWillAppear:animated can cause weird behavior when setting the new frame.

Warning

If setting the rootViewController when the app returns to the foreground, the app should register for the UIApplicationDidBecomeActive notification and not the UIApplicationWillEnterForeground notification. Setting the frame after a notification from the latter can also cause weird behavior when setting the new frame.

Warning

While viewDidLoad will fire, appearance methods will not.

Objective-C

@property (nonatomic, strong, nullable) UIViewController *rootViewController;

Swift

var rootViewController: UIViewController? { get set }

carWindowRenderingType

Declares if CarWindow will use layer rendering or view rendering. Defaults to layer rendering.

Objective-C

@property (nonatomic) SDLCarWindowRenderingType carWindowRenderingType;

Swift

var carWindowRenderingType: SDLCarWindowRenderingType { get set }

enableForcedFramerateSync

When YES, the StreamingMediaManager will run a CADisplayLink with the framerate set to the video encoder settings kVTCompressionPropertyKey_ExpectedFrameRate. This then forces TouchManager (and CarWindow, if used) to sync their callbacks to the framerate. If using CarWindow, this must be YES. If NO, enableSyncedPanning on SDLTouchManager will be set to NO. Defaults to YES.

Objective-C

@property (nonatomic) BOOL enableForcedFramerateSync;

Swift

var enableForcedFramerateSync: Bool { get set }

allowMultipleViewControllerOrientations

When YES, the StreamingMediaManager will disable its internal checks that the rootViewController only has one supportedOrientation. Having multiple orientations can cause streaming issues. If you wish to disable this check, set it to YES. Defaults to NO.

Objective-C

@property (nonatomic) BOOL allowMultipleViewControllerOrientations;

Swift

var allowMultipleViewControllerOrientations: Bool { get set }

supportedLandscapeStreamingRange

Set a landscape image dimension range and/or aspect ratio range that your rootViewController supports. If the module’s screen size for your app changes during streaming (i.e. to a collapsed view, split screen, preview mode or picture-in-picture), your rootViewController will be resized to the new screen size. If left unset or set to nil, the default is to support all landscape streaming ranges. If you wish to disable support for streaming in landscape mode, set a disabled video streaming range. If desired, you can subscribe to screen size updates via the SDLStreamingVideoDelegate.

Warning

If you disable both the supportedLandscapeStreamingRange and supportedPortraitStreamingRange, video will not stream

Objective-C

@property (nonatomic, strong, nullable) SDLVideoStreamingRange *supportedLandscapeStreamingRange;

Swift

var supportedLandscapeStreamingRange: SDLVideoStreamingRange? { get set }

supportedPortraitStreamingRange

Set a portrait image dimension range and/or aspect ratio range that your rootViewController supports. If the module’s screen size for your app changes during streaming (i.e. to a collapsed view, split screen, preview mode or picture-in-picture), your rootViewController will be resized to the new screen size. If left unset or set to nil, the default is to support all portrait streaming ranges. If you wish to disable support for streaming in portrait mode, set a disabled video streaming range. If desired, you can subscribe to screen size updates via the SDLStreamingVideoDelegate.

Warning

If you disable both the supportedLandscapeStreamingRange and supportedPortraitStreamingRange, video will not stream

Objective-C

@property (nonatomic, strong, nullable) SDLVideoStreamingRange *supportedPortraitStreamingRange;

Swift

var supportedPortraitStreamingRange: SDLVideoStreamingRange? { get set }

delegate

The configuration delegate, this is an object conforming to the SDLStreamingVideoDelegate protocol. If video streaming parameters change then this object will be called on.

Objective-C

@property (nonatomic, weak, nullable) id<SDLStreamingVideoDelegate> delegate;

-init

Create an insecure video streaming configuration. No security managers will be provided and the encryption flag will be set to None. If you’d like custom video encoder settings, you can set the property manually.

Objective-C

- (nonnull instancetype)init;

Swift

init()

Return Value

The configuration

+secureConfiguration

Create a secure video streaming configuration. Security managers will be provided from SDLEncryptionConfiguration and the encryption flag will be set to SDLStreamingEncryptionFlagAuthenticateAndEncrypt. If you’d like custom video encoder settings, you can set the property manually.

Objective-C

+ (nonnull instancetype)secureConfiguration;

Swift

class func secure() -> Self

Return Value

The configuration

-initWithEncryptionFlag:videoSettings:dataSource:rootViewController:

Manually set all the properties to the streaming media configuration

Objective-C

- (nonnull instancetype)
    initWithEncryptionFlag:(SDLStreamingEncryptionFlag)encryptionFlag
             videoSettings:
                 (nullable NSDictionary<NSString *, id> *)videoSettings
                dataSource:
                    (nullable id<SDLStreamingMediaManagerDataSource>)dataSource
        rootViewController:(nullable UIViewController *)rootViewController;

Parameters

encryptionFlag

The maximum encryption supported. If the connected head unit supports less than set here, it will still connect, but if it supports more than set here, it will not connect.

videoSettings

Custom video encoder settings to be used in video streaming.

rootViewController

The UIViewController with the content that is being streamed on, to use for haptics if needed and possible (only works for UIViews)

Return Value

The configuration

-initWithEncryptionFlag:videoSettings:supportedLandscapeRange:supportedPortraitRange:dataSource:delegate:rootViewController:

Manually set all the properties to the streaming media configuration

Objective-C

- (nonnull instancetype)
     initWithEncryptionFlag:(SDLStreamingEncryptionFlag)encryptionFlag
              videoSettings:
                  (nullable NSDictionary<NSString *, id> *)videoSettings
    supportedLandscapeRange:(nullable SDLVideoStreamingRange *)landscapeRange
     supportedPortraitRange:(nullable SDLVideoStreamingRange *)portraitRange
                 dataSource:
                     (nullable id<SDLStreamingMediaManagerDataSource>)dataSource
                   delegate:(nullable id<SDLStreamingVideoDelegate>)delegate
         rootViewController:(nullable UIViewController *)rootViewController;

Parameters

encryptionFlag

The maximum encryption supported. If the connected head unit supports less than set here, it will still connect, but if it supports more than set here, it will not connect

videoSettings

Custom video encoder settings to be used in video streaming

landscapeRange

Set a landscape image dimension range and/or aspect ratio range that your app supports

portraitRange

Set a portrait image dimension range and/or aspect ratio range that your rootViewController supports

dataSource

Allows you to respond with preferred resolutions and/or formats

delegate

Provides a delegate with notifications about changes to the audio stream

rootViewController

A view controller that should be automatically streamed

+insecureConfiguration

Create an insecure video streaming configuration. No security managers will be provided and the encryption flag will be set to None. If you’d like custom video encoder settings, you can set the property manually. This is equivalent to init.

Objective-C

+ (nonnull instancetype)insecureConfiguration;

Return Value

The configuration

+autostreamingInsecureConfigurationWithInitialViewController:

Create a CarWindow insecure configuration with a view controller

Objective-C

+ (nonnull instancetype)
    autostreamingInsecureConfigurationWithInitialViewController:
        (nonnull UIViewController *)initialViewController;

Swift

class func autostreamingInsecureConfiguration(withInitialViewController initialViewController: UIViewController) -> Self

Parameters

initialViewController

The initial view controller that will be streamed

Return Value

The configuration

+autostreamingSecureConfigurationWithInitialViewController:

Create a CarWindow secure configuration with a view controller.

Objective-C

+ (nonnull instancetype)
    autostreamingSecureConfigurationWithInitialViewController:
        (nonnull UIViewController *)initialViewController;

Swift

class func autostreamingSecureConfiguration(withInitialViewController initialViewController: UIViewController) -> Self

Parameters

initialViewController

The initial view controller that will be streamed, this can be a basic UIViewController if you need to set your actual streaming view controller at a later time on SDLManager.streamingManager.rootViewController.

Return Value

The configuration

View on GitHub.com
Previous Section Next Section