Skip to content

Commit

Permalink
Merge pull request #494 from vimeo/progressive-to-download
Browse files Browse the repository at this point in the history
Support download property on Video
  • Loading branch information
anthonycr authored Jun 24, 2021
2 parents 6693758 + 95c9669 commit 0e91b33
Show file tree
Hide file tree
Showing 16 changed files with 172 additions and 210 deletions.
13 changes: 2 additions & 11 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 0 additions & 37 deletions models/detekt_baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -546,43 +546,6 @@
<ID>UndocumentedPublicProperty:UserInteractions.kt$UserInteractions$/** * Information related to the Twitter connected app. */ @Json(name = "twitter_connected_app") val twitterConnectedApp: ConnectedAppInteraction? = null</ID>
<ID>UndocumentedPublicProperty:UserInteractions.kt$UserInteractions$/** * Information related to the YouTube connected app. */ @Json(name = "youtube_connected_app") val youTubeConnectedApp: ConnectedAppInteraction? = null</ID>
<ID>UndocumentedPublicProperty:UserInteractions.kt$UserInteractions$/** * Information related to the block status of this user. */ @Json(name = "block") val block: BasicInteraction? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * 360 spatial data. */ @Json(name = "spatial") val spatial: Spatial? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * A brief explanation of the video's content. */ @Json(name = "description") val description: String? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * A collection of stats associated with this video. */ @Json(name = "stats") val stats: VideoStats? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * An array of all tags assigned to this video. */ @Json(name = "tags") val tags: List&lt;Tag&gt;? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * Information about embedding this video. */ @Json(name = "embed") val embed: VideoEmbed? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * Information about the Vimeo Create session of a video. */ @Json(name = "edit_session") val editSession: EditSession? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * Information about the file transfer page associated with this video. This data * requires a bearer token with the private scope. */ @Internal @Json(name = "file_transfer") val fileTransferPage: FileTransferPage? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * Information about the folder that contains the video, or null if it is in the root directory. */ @Json(name = "parent_project") val parentFolder: Folder? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * Information about the review page associated with this video. This data requires a * bearer token with the private scope. */ @Internal @Json(name = "review_page") val reviewPage: ReviewPage? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * Information for the video's badge. */ @Json(name = "badge") val badge: VideoBadge? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * Live playback information. */ @Json(name = "live") val live: Live? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The Creative Commons license used for the video. * @see Video.licenseType */ @Json(name = "license") val license: String? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The Play representation. */ @Internal @Json(name = "play") val play: Play? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The active picture for this video. */ @Json(name = "pictures") val pictures: PictureCollection? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The categories to which this video belongs. */ @Json(name = "categories") val categories: List&lt;Category&gt;? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The content ratings of this video. */ @Json(name = "content_rating") val contentRating: List&lt;String&gt;? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The context of the video's subscription, if this video is part of a subscription. */ @Json(name = "context") val context: VideoContext? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The link to the video. */ @Json(name = "link") val link: String? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The privacy-enabled password to watch this video. * This data requires a bearer token with the private scope. */ @Internal @Json(name = "password") val password: String? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The resource key string of the video. */ @Json(name = "resource_key") val resourceKey: String? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The status code for the availability of the video. This field is deprecated in favor * of [upload] and [transcode]. * @see Video.statusType */ @Json(name = "status") @Deprecated("This property is deprecated in favor of upload and transcode.") val status: String? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The time in ISO 8601 format when the user last modified the video. */ @Json(name = "last_user_action_event_date") val lastUserActionEventDate: Date? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The time in ISO 8601 format when the video metadata was last modified. */ @Json(name = "modified_time") val modifiedTime: Date? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The time in ISO 8601 format when the video was created. */ @Json(name = "created_time") val createdTime: Date? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The time in ISO 8601 format when the video was released. */ @Json(name = "release_time") val releaseTime: Date? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The transcode information for a video upload. */ @Json(name = "transcode") val transcode: Transcode? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The upload information for this video. */ @Json(name = "upload") val upload: Upload? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The video owner. */ @Json(name = "user") val user: User? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The video's canonical relative URI. */ @Json(name = "uri") val uri: String? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The video's duration in seconds. */ @Json(name = "duration") val duration: Int? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The video's height in pixels. */ @Json(name = "height") val height: Int? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The video's metadata. */ @Json(name = "metadata") val metadata: Metadata&lt;VideoConnections, VideoInteractions&gt;? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The video's primary language. */ @Json(name = "language") val language: String? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The video's privacy setting. */ @Json(name = "privacy") val privacy: Privacy? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The video's title. */ @Json(name = "name") val name: String? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * The video's width in pixels. */ @Json(name = "width") val width: Int? = null</ID>
<ID>UndocumentedPublicProperty:Video.kt$Video$/** * Whether the clip is playable. */ @Json(name = "is_playable") val isPlayable: Boolean? = null</ID>
<ID>UndocumentedPublicProperty:VideoBadge.kt$VideoBadge$/** * The badge image. */ @Json(name = "pictures") val pictures: PictureCollection? = null</ID>
<ID>UndocumentedPublicProperty:VideoBadge.kt$VideoBadge$/** * The festival that this badge represents. */ @Internal @Json(name = "festival") val festival: String? = null</ID>
<ID>UndocumentedPublicProperty:VideoBadge.kt$VideoBadge$/** * The link for the badge */ @Json(name = "link") val link: String? = null</ID>
Expand Down
2 changes: 2 additions & 0 deletions models/src/main/java/com/vimeo/networking2/Billing.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:JvmName("BillingUtils")

package com.vimeo.networking2

import com.squareup.moshi.Json
Expand Down
4 changes: 2 additions & 2 deletions models/src/main/java/com/vimeo/networking2/DashVideoFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.vimeo.networking2
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import com.vimeo.networking2.annotations.Internal
import com.vimeo.networking2.common.VideoFile
import com.vimeo.networking2.common.LoggingVideoFile
import java.util.Date

/**
Expand Down Expand Up @@ -44,4 +44,4 @@ data class DashVideoFile(
@Internal
@Json(name = "license_link")
val licenseLink: String? = null
) : VideoFile
) : LoggingVideoFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@file:JvmName("DownloadableVideoFileUtils")

package com.vimeo.networking2

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import com.vimeo.networking2.common.VideoFile
import com.vimeo.networking2.enums.VideoQualityType
import com.vimeo.networking2.enums.VideoSourceType
import com.vimeo.networking2.enums.asEnum
import java.util.Date

/**
* A downloadable video file.
*
* @param publicName A name describing the file, suitable for display.
* @param size The size of the file, in bytes.
* @param sizeShort A short description of the file size, accurate to two decimal places.
* @param md5 The MD5 hash of the file.
* @param width The width of the video content, in pixels.
* @param height The height of the video content, in pixels.
* @param videoQuality The quality of the video file. See [qualityType].
* @param fps The FPS of the video file.
* @param rawType The type of the video file. See [type].
*/
@JsonClass(generateAdapter = true)
data class DownloadableVideoFile(

@Json(name = "public_name")
val publicName: String? = null,

@Json(name = "size")
val size: Long? = null,

@Json(name = "size_short")
val sizeShort: String? = null,

@Json(name = "md5")
val md5: String? = null,

@Json(name = "link")
override val link: String? = null,

@Json(name = "width")
val width: Int? = null,

@Json(name = "height")
val height: Int? = null,

@Json(name = "quality")
val videoQuality: String? = null,

@Json(name = "expires")
override val linkExpirationTime: Date? = null,

@Json(name = "fps")
val fps: Double? = null,

@Json(name = "type")
val rawType: String? = null
) : VideoFile

/**
* @see DownloadableVideoFile.videoQuality
* @see VideoQualityType
*/
val DownloadableVideoFile.qualityType: VideoQualityType
get() = videoQuality.asEnum(VideoQualityType.UNKNOWN)

/**
* @see DownloadableVideoFile.rawType
* @see VideoSourceType
*/
val DownloadableVideoFile.type: VideoSourceType
get() = rawType.asEnum(VideoSourceType.UNKNOWN)
4 changes: 2 additions & 2 deletions models/src/main/java/com/vimeo/networking2/HlsVideoFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.vimeo.networking2
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import com.vimeo.networking2.annotations.Internal
import com.vimeo.networking2.common.VideoFile
import com.vimeo.networking2.common.LoggingVideoFile
import java.util.Date

/**
Expand Down Expand Up @@ -31,4 +31,4 @@ data class HlsVideoFile(
@Internal
@Json(name = "live")
val live: LiveHeartbeat? = null
) : VideoFile
) : LoggingVideoFile
31 changes: 9 additions & 22 deletions models/src/main/java/com/vimeo/networking2/Play.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,44 @@ import com.vimeo.networking2.enums.asEnum

/**
* Play information.
*
* @param dash The DASH video file.
* @param hls HLS video files.
* @param progress The play progress in seconds.
* @param progressive Progressive files.
* @param source The source file of the video.
* @param videoPlayStatus The play status of the video. See [Play.videoPlayStatusType].
* @param drm The DRM play data for a protected stream.
*/
@Internal
@JsonClass(generateAdapter = true)
data class Play(

/**
* The DASH video file.
*/
@Internal
@Json(name = "dash")
val dash: DashVideoFile? = null,

/**
* HLS video files.
*/
@Internal
@Json(name = "hls")
val hls: HlsVideoFile? = null,

/**
* The play progress in seconds.
*/
@Internal
@Json(name = "progress")
val progress: PlayProgress? = null,

/**
* Progressive files.
*/
@Deprecated("Use the download property on a Video instead")
@Internal
@Json(name = "progressive")
val progressive: List<ProgressiveVideoFile>? = null,

/**
* The source file of the video.
*/
@Internal
@Json(name = "source")
val source: List<VideoSourceFile>? = null,

/**
* The play status of the video.
* @see Play.videoPlayStatusType
*/
@Internal
@Json(name = "status")
val videoPlayStatus: String? = null,

/**
* The DRM play data for a protected stream.
*/
@Internal
@Json(name = "drm")
val drm: Drm? = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:JvmName("CinemaUtils")
@file:JvmName("ProgrammedContentItemUtils")

package com.vimeo.networking2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.vimeo.networking2

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import com.vimeo.networking2.common.VideoFile
import com.vimeo.networking2.common.LoggingVideoFile
import com.vimeo.networking2.enums.VideoQualityType
import com.vimeo.networking2.enums.VideoSourceType
import com.vimeo.networking2.enums.asEnum
Expand All @@ -13,6 +13,7 @@ import java.util.Date
/**
* The representation of a video file that could be one of a number of types.
*/
@Deprecated("Use DownloadableVideoFile instead")
@JsonClass(generateAdapter = true)
data class ProgressiveVideoFile(

Expand Down Expand Up @@ -81,7 +82,7 @@ data class ProgressiveVideoFile(
@Json(name = "width")
val width: Int? = null

) : VideoFile
) : LoggingVideoFile

/**
* @see ProgressiveVideoFile.videoQuality
Expand Down
2 changes: 2 additions & 0 deletions models/src/main/java/com/vimeo/networking2/TeamMembership.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:JvmName("TeamMembershipUtils")

package com.vimeo.networking2

import com.squareup.moshi.Json
Expand Down
Loading

0 comments on commit 0e91b33

Please sign in to comment.