Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEC-10717 Added Linear media type recognition by OTT BE response. #42

Merged
merged 1 commit into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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