Skip to content

Commit

Permalink
FEC-10717 Added Linear media type recognition by OTT BE response. (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
chausov authored Feb 18, 2021
1 parent 39aaf4e commit 040a6d3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Sources/OTT/Model/OTTLiveAsset.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
// ===================================================================================================
// Copyright (C) 2018 Kaltura Inc.
//
// Licensed under the AGPLv3 license, unless a different license for a
// particular library is specified in the applicable library path.
//
// You may obtain a copy of the License at
// https://www.gnu.org/licenses/agpl-3.0.html
// ===================================================================================================

import Foundation
import SwiftyJSON

fileprivate let enableTrickPlayKey = "enableTrickPlay"

public class OTTLiveAsset: OTTMediaAsset {

/** Is trick-play enabled for this asset */
var enableTrickPlay: Bool?

public required init?(json: Any) {
super.init(json: json)

let jsonObj: JSON = JSON(json)
self.enableTrickPlay = jsonObj[enableTrickPlayKey].bool
}
}
6 changes: 5 additions & 1 deletion Sources/OTT/Provider/PhoenixMediaProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,12 @@ public enum PhoenixMediaProviderError: PKError {
mediaEntry.tags = tags
}

if let _ = asset as? OTTLiveAsset {
if let asset = asset as? OTTLiveAsset {
mediaEntry.mediaType = .live

if let enableTrickPlay = asset.enableTrickPlay, enableTrickPlay {
mediaEntry.mediaType = .dvrLive
}
}

if loaderInfo.assetType == .epg && loaderInfo.playbackContextType == .startOver {
Expand Down

0 comments on commit 040a6d3

Please sign in to comment.