-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '785e68df381105dee0e75fef1fe18d700f864c66' into FEM-1248-…
…Core * commit '785e68df381105dee0e75fef1fe18d700f864c66': add supported version under CC sdk dependency (#143) replace raw value to asString (#141) Fem 1333 (#140) FEM-1318 (#139) FEM-1320 (#138) Fem 1311 (#136) General improvements (#135) # Conflicts: # Classes/Providers/OTT/Services/OTTAssetService.swift
- Loading branch information
Showing
26 changed files
with
442 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// KalturaPlaybackRequestAdapter.swift | ||
// Pods | ||
// | ||
// Created by Gal Orlanczyk on 05/04/2017. | ||
// | ||
// | ||
|
||
import Foundation | ||
|
||
class KalturaPlaybackRequestAdapter: PKRequestParamsAdapter { | ||
|
||
private var playSessionId: UUID | ||
|
||
init(playSessionId: UUID) { | ||
self.playSessionId = playSessionId | ||
} | ||
|
||
public static func setup(player: Player) { | ||
let adapter = KalturaPlaybackRequestAdapter(playSessionId: player.sessionId) | ||
player.settings.set(contentRequestAdapter: adapter) | ||
} | ||
|
||
public func adapt(requestParams: PKRequestParams) -> PKRequestParams { | ||
guard requestParams.url.path.contains("/playManifest/") else { return requestParams } | ||
guard var urlComponents = URLComponents(url: requestParams.url, resolvingAgainstBaseURL: false) else { return requestParams } | ||
// add query items to the request | ||
let queryItems = [URLQueryItem(name: "playSessionId", value: self.playSessionId.uuidString), URLQueryItem(name: "clientTag", value: PlayKitManager.clientTag)] | ||
if var urlQueryItems = urlComponents.queryItems { | ||
urlQueryItems += queryItems | ||
urlComponents.queryItems = urlQueryItems | ||
} else { | ||
urlComponents.queryItems = queryItems | ||
} | ||
// create the url | ||
guard let url = urlComponents.url else { | ||
PKLog.debug("failed to create url after appending query items") | ||
return requestParams | ||
} | ||
return PKRequestParams(url: url, headers: requestParams.headers) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// PKRequestInfo.swift | ||
// Pods | ||
// | ||
// Created by Gal Orlanczyk on 04/04/2017. | ||
// | ||
// | ||
|
||
import Foundation | ||
|
||
/// `PKRequestParamsDecorator` used for getting updated request info | ||
@objc public protocol PKRequestParamsAdapter { | ||
func adapt(requestParams: PKRequestParams) -> PKRequestParams | ||
} | ||
|
||
@objc public class PKRequestParams: NSObject { | ||
|
||
public let url: URL | ||
public let headers: [String: String]? | ||
|
||
init(url: URL, headers: [String: String]?) { | ||
self.url = url | ||
self.headers = headers | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.