iOS SDK Version Comparison
This page provides information about APIs and features that are no longer supported by the current iOS SDK release but may be in use by developers that are using prior versions of the SDK. Links to the GA version of the documentation are provided when possible.
A copy of the deprecated documentation is shown with a blue background for easier identification when comparing to current documentation.
All deprecated documentation is watermarked DEPRECATED to allow easy identification.
v2022.0.4 and Earlier
PCast™ Express
Newer versions of PCast™ Express do not support certain arguments in
- PhenixPCastExpressOptionsBuilder
- PublishOptionsBuilder
- SubscribeOptionsBuilder
Using these arguments with the newer SDK will result in a failure such as unrecognised option
.
Some APIs, such as Publishing Remote Media (Ingest), are not supported by newer versions of the SDK.
In addition, token arguments are required when using the newer SDK
(e.g., withStreamToken
or withAuthenticationToken
), and not including tokens will
result in a failure such as bad-request
.
Initializing PCast™ Express
Current version: Initializing
Deprecated version:
import PhenixSdk
let pcastExpressOptions = PhenixPCastExpressFactory.createPCastExpressOptionsBuilder()
.withBackendUri("https://example.yourdomain.com/phenix/")
.buildPCastExpressOptions()
let pcastExpress = PhenixPCastExpressFactory.createPCastExpress(pcastExpressOptions)
PhenixPCastExpressOptionsBuilder
Name | Type | Default | Description |
---|---|---|---|
withBackendUri (required) | NSString | Url to your backend. We send requests here to authenticate and get streaming tokens. | |
withAuthenticationData (optional) | NSString | Your authentication data for the user. On every request, this will be sent to your backend through a HTTP POST request and all its attributes would be accessible on the request body. Needs to be valid JSON. | |
withAuthenticationToken (optional) | NSString | The authentication token generated using the Phenix EdgeAuth library. | |
withUnrecoverableErrorCallback (optional) | PhenixPCastExpressUnrecoverableErrorCallback | Function to be called when authentication fails or a failure occurs that is unrecoverable. | |
withPCastUri (optional) | NSString | Allows overriding default PCast™ URI. | |
withPCastInitializationOptions (optional) | PhenixPCastInitializeOptions | Use custom options when initializing PCast™. | |
withAuthenticationRouteOverride (optional) | NSString | auth | Allows override of default route for authentication tokens |
withStreamRouteOverride (optional) | NSString | stream | Allows override of default route for stream tokens |
buildPCastExpressOptions | none | Builds the PhenixPCastExpressOptions |
Publishing Local Media
Current version: Publishing Local Media
Deprecated version:
import PhenixSdk
let pcastExpress: PhenixPCastExpress = ... // previously obtained
let userMediaConstraints = PhenixUserMediaOptions()
userMediaConstraints.video.enabled = true
userMediaConstraints.video.capabilityConstraints[PhenixDeviceCapability.facingMode.rawValue] =
[PhenixDeviceConstraint.initWith(PhenixFacingMode.user)]
userMediaConstraints.audio.enabled = true
userMediaConstraints.audio.capabilityConstraints[PhenixDeviceCapability.audioEchoCancelationMode.rawValue] =
[PhenixDeviceConstraint.initWith(PhenixAudioEchoCancelationMode.on)]
let publishOptions = PhenixPCastExpressFactory.createPublishOptionsBuilder()
.withCapabilities(["real-time"])
.withMediaConstraints(userMediaConstraints)
.buildPublishOptions()
pcastExpress.publish(publishOptions) { (status: PhenixRequestStatus, publisher: PhenixExpressPublisher?) in
if status == .ok {
// Do something with publisher
} else {
// Handle error
}
}
// Create a publisher with an automatically started preview renderer
let renderLayer: CALayer = ... // previously obtained
let publishOptionsWithPreview = PhenixPCastExpressFactory.createPublishOptionsBuilder()
.withCapabilities(["real-time"])
.withMediaConstraints(userMediaConstraints)
.withPreviewRenderer(renderLayer)
.buildPublishOptions()
pcastExpress.publish(withPreview: publishOptionsWithPreview) {
(status: PhenixRequestStatus, publisher: PhenixExpressPublisher?, preview: PhenixRenderer?) in
if status == .ok {
// Do something with publisher and preview renderer
} else {
// Handle error
}
}
✂ Unchanged content not shown
PhenixPublishOptionsBuilder
Name | Type | Default | Description |
---|---|---|---|
withMediaConstraints (required) | PhenixUserMediaOptions | getUserMedia options Constraints to get the user media. | |
withUserMedia (optional) | PhenixUserMediaStream | alternative to withMediaConstraints - you can pass user media stream returned from getUserMedia. | |
withCapabilities (optional) | NSArray of NSString | The list of all capabilities to publish with. Default is empty array. | |
withPreviewRenderer (optional) | CALayer | Render layer on which to display local preview. If none of the withPreview... methods are called, no preview renderer will be instantiated. | |
withPreviewRenderer (optional) | none | Will trigger instantiation of preview renderer. Useful for audio only type streams that do not require a render surface. | |
withPreviewRendererOptions (optional) | PhenixRendererOptions | Options passed to preview renderer. Will trigger instantiation of preview renderer. | |
withMonitor (optional) | PhenixMonitorSetupFailedCallback, PhenixMonitorStreamEndedCallback, PhenixMonitorOptions | Options for monitoring a publisher for failure. | |
withConnectOptions (optional) | NSArray of NSStrings | List of options for publishing. | |
withTags (optional) | NSArray of NSStrings | Tags for the stream. | |
withStreamToken (optional) | NSString | The publish token generated using the Phenix EdgeAuth library. | |
buildPublishOptions | none | Builds the PhenixPublishOptions |
Publishing Remote Media (Ingest)
Current version: This API is not supported by the current version of the iOS SDK. To publish remote media, please use the REST API for publishing a stream from a URI.
Deprecated version:
Publish from remote sources into the Phenix platform. This enables us to distribute your source media using the Phenix platform. After publishing users may subscribe to the stream using either pcast subscribe or express subscribe.
import PhenixSdk
let pcastExpress: PhenixPCastExpress = ... // previously obtained
let publishRemoteOptions = PhenixPCastExpressFactory.createPublishRemoteOptionsBuilder()
.withStreamUri("http://mycdn.example.com/mystream.mp4")
.withCapabilities([""])
.buildPublishRemoteOptions()
pcastExpress.publishRemote(publishRemoteOptions) { (status: PhenixRequestStatus, publisher: PhenixExpressPublisher?) in
if status == .ok {
// Do something with publisher
} else {
// Handle error
}
}
Publishing Remote Media Parameters
Name | Type | Description |
---|---|---|
options (required) | PhenixPublishRemoteOptions | Publish Remote options |
callback (required) | function | Callback for error/success handling |
PhenixPublishRemoteOptionsBuilder
Name | Type | Default | Description |
---|---|---|---|
withCapabilities (required) | NSArray of NSString | The list of all capabilities to publish with. | |
withStreamUri (required) | NSString | Link to remote media (mp4, rtmp, etc.) | |
withStreamToken (optional) | NSString | The publish token generated using the Phenix EdgeAuth library. | |
withConnectOptions (optional) | NSArray of NSStrings | List of options for publishing from a remote source. | |
withTags (optional) | NSArray of NSStrings | Tags for the stream | |
withMaximumFrameRateConstraint (optional) | double | Maximum frame rate constraint. | |
withExactFrameRateConstraint (optional) | double | Exact frame rate constraint. | |
withPrerollSkipDuration (optional) | NSTimeInterval | 500 | The amount of time to skip at the beginning of the media. |
buildPublishRemoteOptions | none | Builds the PhenixPublishRemoteOptions |
Publishing Remote Media Callback Arguments
Name | Type | Description |
---|---|---|
status | PhenixRequestStatus | The status of the operation. |
publisher | PhenixExpressPublisher | Phenix publisher object |
Subscribing to Published Media
Current version: Subscribing to Published Media
Deprecated version:
import PhenixSdk
let pcastExpress: PhenixPCastExpress = ... // previously obtained
let renderLayer: CALayer = ... // previously obtained
let subscribeOptions = PhenixPCastExpressFactory.createSubscribeOptionsBuilder()
.withStreamId("us-west#us-west1-b.zzzzzzzz.20000000.xxxxxxxx")
.withCapabilities(["real-time"])
.withRenderer(renderLayer)
.buildSubscribeOptions()
pcastExpress.subscribe(subscribeOptions) { (status: PhenixRequestStatus, subscriber: PhenixExpressSubscriber?, renderer: PhenixRenderer?) in
if status == .ok {
// Do something with subscriber
if let renderer = renderer {
// Returned if `withRenderer...` option was enabled - Do something with renderer
}
} else {
// Handle error
}
}