Configure your project
Configure your iOS project.
To use the SDK in your project, you must add the player license key and import the JWPlayerKit
module where necessary.
Swift
- In Xcode, open AppDelegate.swift.
- Set the player license key by calling the
JWPlayerKitLicense
methodsetLicenseKey
inapplication:didFinishLaunchingWithOptions
.
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]?) -> Bool {
JWPlayerKitLicense.setLicenseKey("YOUR_KEY_HERE")
return true
}
TIP
For added flexibility, you should consider remotely storing the key and setting it at runtime. This approach enables you to update the license key of the player without needing to resubmit your app to the App Store.
- Import
JWPlayerKit
into any file that will need access to the SDK.
import JWPlayerKit
You have configured your project. You can now set up a player.
Objective-C
- In Xcode, open AppDelegate.m.
- Set the player license key by calling the
JWPlayerKitLicense
class methodsetLicenseKey
inapplication:didFinishLaunchingWithOptions
.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[JWPlayerKitLicense setLicenseKey:@"YOUR_KEY_HERE"];
return YES;
}
TIP
For added flexibility, you should consider remotely storing the key and setting it at runtime. This approach enables you to update the license key of the player without needing to resubmit your app to the App Store.
- Import JWPlayerKit-swift.h into any file that will need access to the SDK.
#import <JWPlayerKit/JWPlayerKit-swift.h>
You have configured your project. You can now set up a player.
Updated 10 months ago
Did this page help you?