Skip to main content

Overview


LORA Short Video SDK is a component of the LORA SDK that can be utilized alongside other modules within the LORA SDK or independently. To function properly, the LORA Short Video SDK necessitates the LoraCore module

Features

  • Video Grid View
  • Video Carousel View
  • Video Storyblock View
  • Video Detail Player (with landscape layout support)
  • Playlist
  • PIP

Requirements

  • iOS 11.0+
  • Xcode 13.0 and above

Getting started


Integrate with Carthage

Before utilizing its features, it's essential to initialize the LORA SDK. You can initiate the SDK using the provided code along with the licenseKey. To obtain this licenseKey, please reach out to our support team.

import LoraCore

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.
LaunchOptionsKey: Any]?) -> Bool {
// Initialize LORA SDK
LoraSDK.shared.initWith(licenseKey)
.
.
.
return true
}
}

LORA Short Video SDK is distributed via xcframework which is recommended by Apple since WWDC 2019

  • Step 1: Add frameworks Drag LoraCore.xcframework and LoraShortVideo.xcframework into Frameworks, Libraries, and Embedded Contents and Select Embedded & Sign

  • Step 2: Update Cartfile You may encounter the build error or get crash: dyld: Symbol not found on Xcode 12 and above when using xcframework . Here is a workaround to fix this issue

  • Create file carthage.sh in your root project folder with this content

# carthage.sh
# Usage example: ./carthage.sh build --platform iOS

set -euo pipefail

xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT

# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.

CURRENT_XCODE_VERSION="$(xcodebuild -version | grep "Xcode" | cut -d' ' -f2 | cut -d'.' -f1)00"
CURRENT_XCODE_BUILD=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)

echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x
86_64__XCODE_${CURRENT_XCODE_VERSION}__BUILD_${CURRENT_XCODE_BUILD} =
arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig

echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x
86_64__XCODE_'${CURRENT_XCODE_VERSION}' =
$(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_
x86_64__XCODE_$(XCODE_VERSION_MAJOR)__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))'
>> $xcconfig
echo 'EXCLUDED_ARCHS = $(inherited)
$(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__
NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))'
>> $xcconfig

# build all libraries for distribution
# https://github.com/Carthage/Carthage/issues/2845
echo 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES' >> $xcconfig

export XCODE_XCCONFIG_FILE="$xcconfig"
carthage "$@"
  • Add run permission to this file by chmod +x carthage.sh
  • Instead of running carthage command, we'll change to run carthage.sh. Eg: sh carthage.sh update --platform iOS --no-use-binaries --use-xcframeworks

Integrate with CocoaPods

This is the easiest method to integrate the LORA Short Video SDK into your app. You can utilize CocoaPods to install the LORA Short Video SDK by adding it to your Podfile.

platform :ios, '11.0'
use_frameworks!
pod 'LoraCore', :path => '../framework/LoraCore' # path to podspec file
pod 'LoraShortVideo', :path => '../framework/LoraShortVideo' # path to podspec file

Initialize SDK

Before utilizing its features, it's essential to initialize the LORA SDK. You can initiate the SDK using the provided code along with the licenseKey. To obtain this licenseKey, please reach out to our support team.

import LoraCore

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.
LaunchOptionsKey: Any]?) -> Bool {
// Initialize LORA SDK
LoraSDK.shared.initWith(licenseKey)
.
.
.
return true
}
}