This topic describes how to update Push SDK for iOS from V4.0.2 to V4.1.0 or later.
Prerequisites
For information about the new versions of Push SDK, see SDK download and release notes.
Procedure
Remove the class libraries and resource files of Push SDK V4.0.2 from your project. Then, add the class libraries and resource files of Push SDK V4.1.0 or later to your project.
- In the libs directory, use AlivcLivePusher.framework and AlivcLibRtmp.framework of Push SDK V4.1.0 or later to replace AliLivesdk.framework of Push SDK V4.0.2.
- Update the ApsaraVideo Player SDK to AliyunPlayer. For more information, see SDK and the SDK used in the demo.
- If you want to implement the smart retouching feature in your app, view the usage instructions in the demo. This facilitates the integration of the Queen SDK and UI.
- Modify specific methods, as described in the Key methods section of this topic.
- Modify specific methods for the major process, as described in the Changes in the methods for major process section of this topic.
Key methods
- Basic methods
V4.0.2 V4.1.0 and later Description getSdkVersion getSdkVersion Queries the version of Push SDK. initWithConfig initWithConfig Creates a stream ingest object. destorySdk destory Destroys the stream ingest object. - setStatusDelegate
- setRtsDelegate
- setVidePreProcessDelegate
- setDataStatsDelegate
- AlivcPublisherViewDelegate
- AlivcLivePusherInfoDelegate
- AlivcLivePusherErrorDelegate
Sets the callback for the audio and video streams of a fan during stream ingest over Real-Time Communication (RTC). To set video preprocessing callbacks, use the AliLiveRtsDelegate class. Sets the callback for parameters that are related to live streaming media. setNetworkDelegate AlivcLivePusherNetworkDelegate Sets the callback for the network status during stream ingest. setLogDirPath N/A: Custom logs are written. Sets the path for storing the log files of Push SDK. To prevent log loss, you must call this method before other methods. In addition, make sure that the specified path exists and is writable. setLogLevel N/A Sets the log level. - Basic stream ingest methods
V4.0.2 V4.1.0 and later Description startPreview startPreview Starts the preview. This method is called on the streamer side. stopPreview stopPreview Stops the preview. This method is called on the streamer side. pausePush pause Stops the camera from collecting live streams and ingests standby streams. This method is supported only for stream ingest over RTMP. You must call the startPush method before the pausePush method to prevent an invalid call order. resumePush resume() Enables the camera to collect live streams again and stops ingesting standby streams. This method is supported only for stream ingest over RTMP. You must call the pausePush method before the resumePush method to prevent an invalid call order. startPush startPushWithURL Starts to ingest streams. stopPush stopPush Stops ingesting streams. isPublishing isPushing Queries whether streams are being ingested. getPublishUrl getPushURL Queries the current ingest URL. - Video-related methods
V4.0.2 V4.1.0 and later Description setPreviewMode setpreviewDisplayMode Sets the preview mode. switchCamera switchCamera Switches between the front and the rear cameras. setCameraZoom setZoom Sets the zoom factor of the camera and specifies whether to enable the flash. isCameraExposurePointSupported setExposure Queries whether an exposure point can be set for the camera. setCameraFocusPoint setAutoFocus Sets the focus point of the camera. - Audio-related methods
V4.0.2 V4.1.0 and later Description setMute setMute Specifies whether the frames collected from the local audio are mute frames. isAudioOnly isAudioOnly Queries whether the ingested streams are audio-only streams. enableEarBack setBGMEarsBack Enables in-ear monitoring. To prevent echoes, we recommend that you enable in-ear monitoring after you insert the headset. playBGM startBGMAsync Plays background music. stopBGM stopBGM Stops playing background music. pauseBGM pauseBGM Pauses the playback of background music. resumeBGM resumeBGM Resumes the playback of background music. setBGMVolume setBGMVolume Sets the volume of background music.