Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
PruthiviRaj27 committed Aug 20, 2024
1 parent ec9320d commit c7dd5cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion player/src/main/java/com/tpstream/player/data/Asset.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ data class Video(
var bytesDownloaded: Long = 0,
var totalSize: Long = 0,
var downloadState: DownloadStatus? = null,
val tracks: List<Track>? = null
val tracks: List<Track>? = null,
val enableDRM: Boolean? = false
){
val isTranscodingCompleted: Boolean
get() = transcodingStatus == "Completed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ internal fun LocalAsset.asDomainAsset(): Asset {
downloadState = this.downloadState,
width = this.videoWidth,
height = this.videoHeight,
enableDRM = this.url.isDRMVideo()
),
folderTree = this.folderTree,
downloadStartTimeMs = this.downloadStartTimeMs,
Expand Down Expand Up @@ -52,7 +53,8 @@ internal fun NetworkAsset.asDomainAsset(): Asset {
transcodingStatus = transcodingStatus ?: "",
tracks = this.networkVideo?.tracks?.map {
it.asDomainTracks()
}
},
enableDRM = networkVideo?.enable_drm
),
description = description ?: "",
liveStream = getDomainLiveStream(this),
Expand Down Expand Up @@ -108,3 +110,5 @@ internal fun Asset.asLocalAsset(): LocalAsset {
metadata = this.metadata
)
}

internal fun String.isDRMVideo() = this.contains(".mpd")

0 comments on commit c7dd5cf

Please sign in to comment.