Delegates

    Delegates


    Article summary

    ShopLiveShortformEditorSDK Delegate

    ShopLiveVideoEditorDelegate

    This is a delegate that allows you to receive events that occur when you use ShopLiveVideoEditor.

    @objc public protocol ShopLiveVideoEditorDelegate : AnyObject {
        @objc optional func onShopLiveVideoEditorError(error : ShopLiveCommonError)
        @objc optional func onShopLiveVideoEditorVideoConvertSuccess(videoPath : String)
        @objc optional func onShopLiveVideoEditorUploadSuccess(shortsId : String)
        @objc optional func onShopLiveVideoEditorCancelled()
    }
    • onShopLiveVideoEditorError(error : ShopLiveCommonError)

      • You may receive an error that occurs inside the ShopLiveShortformEditorSDK.

    • onShopLiveVideoEditorVideoConvertSuccess(videoPath : String)

      • After the video is transcoded, you will receive the videoPath of the output.
        The results of the transcoded video are temporarily stored on the app's disk.
        When you're done using the deliverables, call the SLFileManager.deleteFFMpegDirectoryFiles() function to manage the memory on your app's disk.

    • onShopLiveShortformEditorUploadSuccess(shortsId : String)

      • If you successfully create a shortform, you will receive the ID of the generated Shortform.

    • onShopLiveVideoEditorCancelled()

      • ShopLiveVideoEditor is called when the operation is interrupted by a backbutton, for example.


    ShopLiveCoverPickerDelegate

    This is a delegate that allows you to receive events that occur when you use ShopLiveCoverPicker.

    @objc public protocol ShopLiveCoverPickerDelegate : AnyObject {
        @objc optional func onShopLiveCoverPickerError(error : ShopLiveCommonError)
        @objc optional func onShopLiveCoverPickerCoverImageSuccess(image : UIImage?)
        @objc optional func onShopLiveCoverPickerUploadSuccess(shortsId : String)
        @objc optional func onShopLiveCoverPickerCancelled()
    }
    • onShopLiveCoverPickerError(error : ShopLiveCommonError)

      • You may receive an error that occurs inside the ShopLiveShortformEditorSDK.

    • onShopLiveCoverPickerCoverImageSuccess(image : UIImage?)

      • After the video is transcoded, you will receive the videoPath of the output.
        The results of the transcoded video are temporarily stored on the app's disk.
        When you're done using the deliverables, call the SLFileManager.deleteFFMpegDirectoryFiles() function to manage the memory on your app's disk.

    • onShopLiveCoverPickerUploadSuccess(shortsId : String)

      • If you successfully create a cover for your shortform, you will receive the ID of the generated Shortform.

    • onShopLiveCoverPickerCancelled()

      • ShopLiveCoverPicker is called when the operation is interrupted in the middle of the operation, such as by a back button.


    ShopLiveMediaPickerDelegate

    This is a delegate that allows you to receive events that occur when you use ShopLiveMediaPicker.

    @objc public protocol ShopLiveMediaPickerDelegate : AnyObject {
        @objc optional func onShopLiveMediaPickerError(error : ShopLiveCommonError)
        @objc optional func onShopLiveMediaPickerDidPickVideo(absoluteUrl : URL, relativeUrl : URL)
        @objc optional func onShopLiveMediaPickerDidPickImage(imageUrl : URL)
        @objc optional func onShopLiveMediaPickerCancelled()
    }
    • onShopLiveMediaPickerError(error : ShopLiveCommonError)

      • You may receive an error that occurs inside the ShopLiveShortformEditorSDK.

    • onShopLiveMediaPickerDidPickVideo(absoluteUrl : URL, relativeUrl : URL)

      • You'll receive a URL to the video output of your choice.

    • onShopLiveMediaPickerDidPickImage(imageUrl : URL)

      • You will receive a URL to the selected image deliverable.

    • onShopLiveMediaPickerCancelled()

      • ShopLiveMediaPicker is called when the operation is interrupted by a reason, such as a back button.