Skip to content

Commit

Permalink
Merge pull request #570 from vimeo/MPS-3318-Add-Live-Event
Browse files Browse the repository at this point in the history
MPS-3318 Add live event
  • Loading branch information
howardrigberg authored Jul 13, 2022
2 parents cab96e4 + e355d7e commit a2c9561
Show file tree
Hide file tree
Showing 21 changed files with 628 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Change Log
==========
Version 3.12.0 *(2022-07-07)*
----------------------------
- Added `LiveEvent` data support.
- Added `VimeoApiClient.fetchLiveEvent`

Version 3.11.0 *(2022-07-07)*
----------------------------
- Updated `UploadQuotaPeriodType` to match new values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object ApiConstants {

const val SSL_URL_PATTERN = "*.vimeo.com"

const val SDK_VERSION = "3.11.0"
const val SDK_VERSION = "3.12.0"

const val NONE = -1

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx4096M
version=3.11.0
version=3.12.0

android.useAndroidX=true
android.enableJetifier=true
180 changes: 180 additions & 0 deletions models/src/main/java/com/vimeo/networking2/LiveEvent.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
package com.vimeo.networking2

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import com.vimeo.networking2.common.Entity
import com.vimeo.networking2.enums.PlaylistSortType
import com.vimeo.networking2.enums.asEnum
import java.util.Date

/**
* Live Event data.
* @param autoCCKeywords A comma-separated list of keywords for enhancing the speech detection of automated closed
* captions.
* @param autoCCLanguage The language of the Automated Closed Captions.
* @param autoCCRemaining The amount of time remaining to the user to access the Automated Closed Captions feature.
* @param contentRating The event's granular content ratings. Current values are:
* - 'unrated' - The event hasn't been rated.
* - 'safe' - The event is safe for all audiences.
* - 'advertisement' - The event contains advertisements.
* - 'drugs' - The event contains drug or alcohol use.
* - 'language' - The event contains profanity or sexually suggestive content.
* - 'nudity' - The event contains nudity.
* - 'violence' - The event contains violence.
* @param createdTime The time in ISO 8601 format when the live event was created.
* @param dashLink The upstream MPEG-DASH link. To create a live video on the event, send your live content
* to this link.
* @param embed The live event's embed data.
* @param firstVideoInPlaylist The first video to be played in the playlist.
* @param isAutoCCEnabled Whether the Automated Closed Captions feature is enabled.
* @param isChatEnabled Whether to display live chat on the event page on Vimeo.
* @param isFromShowcase Whether the live event was created from a showcase.
* @param isFromWebinar Whether the live event was created from a webinar.
* @param isLowLatencyEnabled Whether the low latency feature is enabled.
* @param isUnlimitedStreamingEnabled Whether 24/7 streaming is enabled for the event.
* @param link The URI to access the live event on Vimeo.
* @param liveClips A list of videos belonging to the live event, including their video IDs and dates streamed.
* @param metadata Metadata about the live event.
* @param nextOccurrenceTime The ISO 8601 date on which the next occurrence of the event is expected to be live.
* @param parentFolder Information about the folder that contains the event.
* @param pictures The active thumbnail image of the live event.
* @param playlistSort The order in which the videos inside the live event appear in the playlist.
* @param rtmpLink The upstream RTMP link. Send your live content to this link to create a live video on the event.
* @param rtmpsLink The upstream RTMPS link. Send your live content to this link to create a live video on the event.
* @param shouldAutomaticallyTitleStream When the value of this field is true, the title for the next video in the event
* is generated based on the time of the stream and the title field of the event.
* @param shouldIgnoreAutoCCTimeLimit Whether to ignore the time limit of the Automated Closed Captions feature.
* @param streamDescription The description of the next video streamed to the event.
* @param streamKey The stream key used in conjunction with the RTMP and RTMPS links.
* @param streamPassword Anyone with the password can access the videos generated by streaming to the event.
* @param streamPrivacy The initial privacy settings of videos generated by streaming to the event
* as well as the embed privacy of the entire collection.
* @param streamTitle The title of the next video streamed to the event.
* This field applies only when [shouldAutomaticallyTitleStream] is `false`.
* @param streamableVideo The live event's video. A recurring live event always has a video,
* which is either in a pre-live state (ready to be streamed to) or in a live state
* (which is currently being streamed to).
* @param timeZone The time zone used in resolving the timestamps included in auto-generated video titles.
* @param title The title of the live event. This field is also optionally used as the base title for videos
* created by streaming to the event.
* @param uri The live event's canonical relative URI.
* @param user The owner of the live event.
*/
@JsonClass(generateAdapter = true)
data class LiveEvent(

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

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

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

@Json(name = "content_rating")
val contentRating: List<String>? = null,

@Json(name = "created_time")
val createdTime: Date? = null,

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

@Json(name = "embed")
val embed: LiveEventEmbed? = null,

@Json(name = "head_clip")
val firstVideoInPlaylist: Video? = null,

@Json(name = "auto_cc_enabled")
val isAutoCCEnabled: Boolean? = null,

@Json(name = "chat_enabled")
val isChatEnabled: Boolean? = null,

@Json(name = "from_showcase")
val isFromShowcase: Boolean? = null,

@Json(name = "from_webinar")
val isFromWebinar: Boolean? = null,

@Json(name = "low_latency")
val isLowLatencyEnabled: Boolean? = null,

@Json(name = "unlimited_duration")
val isUnlimitedStreamingEnabled: Boolean? = null,

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

@Json(name = "live_clips")
val liveClips: List<Video>? = null,

@Json(name = "metadata")
val metadata: Metadata<LiveEventConnections, LiveEventInteractions>? = null,

@Json(name = "next_occurrence_time")
val nextOccurrenceTime: Date? = null,

@Json(name = "parent_folder")
val parentFolder: Folder? = null,

@Json(name = "pictures")
val pictures: PictureCollection? = null,

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

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

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

@Json(name = "automatically_title_stream")
val shouldAutomaticallyTitleStream: Boolean? = null,

@Json(name = "unlimited_auto_cc")
val shouldIgnoreAutoCCTimeLimit: Boolean? = null,

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

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

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

@Json(name = "stream_privacy")
val streamPrivacy: StreamPrivacy? = null,

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

@Json(name = "streamable_clip")
val streamableVideo: Video? = null,

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

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

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

@Json(name = "user")
val user: User? = null

) : Entity {
override val identifier: String? = uri
}

/**
* @see LiveEvent.playlistSort
* @see PlaylistSortType
*/
val LiveEvent.playlistSortType: PlaylistSortType
get() = playlistSort.asEnum(PlaylistSortType.UNKNOWN)
34 changes: 34 additions & 0 deletions models/src/main/java/com/vimeo/networking2/LiveEventConnections.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.vimeo.networking2

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

/**
* All connections for a live event.
*
* @param liveVideo The connection for the live video for a live event.
* @param pictures The connection for the thumbnail pictures for a live event.
* @param preLiveVideo The connection for the event's pre-live video, where applicable.
* A pre-live video is either activated or in the process of being activated.
* @param teamMembers The connection for team members of the live event owner's team.
* @param videos The connection for the videos that belong to the live event.
*/
@JsonClass(generateAdapter = true)
data class LiveEventConnections(

@Json(name = "live_video")
val liveVideo: LiveVideoConnection? = null,

@Json(name = "pictures")
val pictures: DefaultConnection? = null,

@Json(name = "pre_live_video")
val preLiveVideo: LiveVideoConnection? = null,

@Json(name = "team_member")
val teamMembers: DefaultConnection? = null,

@Json(name = "videos")
val videos: BasicConnection? = null

)
32 changes: 32 additions & 0 deletions models/src/main/java/com/vimeo/networking2/LiveEventCustomLogo.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.vimeo.networking2

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

/**
* Live Event custom logo data.
*
* @param isActive Whether the custom logo appears in the embeddable player.
* @param isSticky Whether the custom logo appears even when the player interface is hidden.
* @param link The URL that loads upon clicking the custom logo.
* @param shouldUseLink Whether the custom logo should use the URL link.
* @param url The URL source of the custom player logo.
*/
@JsonClass(generateAdapter = true)
data class LiveEventCustomLogo(

@Json(name = "active")
val isActive: Boolean? = null,

@Json(name = "sticky")
val isSticky: Boolean? = null,

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

@Json(name = "use_link")
val shouldUseLink: Boolean? = null,

@Json(name = "url")
val url: String? = null
)
104 changes: 104 additions & 0 deletions models/src/main/java/com/vimeo/networking2/LiveEventEmbed.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package com.vimeo.networking2

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

/**
* LiveEvent embed data.
*
* @param chatEmbedSource The chat's iFrame source URL.
* @param color The primary player color, which controls the color of the progress bar, buttons, and more.
* @param embedChat The embed code for RLE chat.
* @param embedProperties The height, width, and source URL properties used to generate the fixed HTML embed code.
* @param html The fixed HTML code to embed the live event's playlist on a website.
* @param logoInfo A collection of information about the logo in the corner of the embeddable player.
* @param responsiveHtml The responsive HTML code to embed the live event's playlist on a website.
* @param shouldAutoplay Whether the embedded RLE player should autoplay the RLE content.
* @param shouldDisplayEventSchedule Whether the embedded RLE player should display the event schedule.
* @param shouldDisplayFullscreenControls Whether the embedded RLE player should include the fullscreen controls.
* @param shouldDisplayLikeButton Whether the embedded RLE player should include the like button.
* @param shouldHideLiveLabel Whether the embedded RLE player should hide the live label.
* @param shouldHideViewerCount Whether the embedded RLE player should hide the viewer count.
* @param shouldLoop Whether the embedded RLE player should loop back to the first video once content is exhausted.
* @param shouldShowName Whether the embedded RLE player should display the author's name.
* @param shouldShowPlayBar Whether the embedded RLE player should include the play bar.
* @param shouldShowPlayList Whether the play list component appears in the embeddable player for this RLE.
* @param shouldShowPortrait Whether the embedded RLE player should display the author's portrait.
* @param shouldShowSchedule Whether the schedule component appears in the embeddable player for this RLE.
* @param shouldShowLatestVideoPlaceholder Whether the embedded RLE player should display the latest video placeholder.
* @param shouldShowVolumeControls Whether the embedded RLE player should include the volume controls.
* @param shouldShowTitle Whether the embedded RLE player should display the video title.
* @param shouldUseCustomColor Whether the embedded RLE player should use a custom color or the default Vimeo blue.
*/
@JsonClass(generateAdapter = true)
data class LiveEventEmbed(

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

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

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

@Json(name = "embed_properties")
val embedProperties: LiveEventEmbedProperties? = null,

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

@Json(name = "logos")
val logoInfo: LiveEventLogoInfo? = null,

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

@Json(name = "autoplay")
val shouldAutoplay: Boolean? = null,

@Json(name = "event_schedule")
val shouldDisplayEventSchedule: Boolean? = null,

@Json(name = "fullscreen_button")
val shouldDisplayFullscreenControls: Boolean? = null,

@Json(name = "like_button")
val shouldDisplayLikeButton: Boolean? = null,

@Json(name = "hide_live_label")
val shouldHideLiveLabel: Boolean? = null,

@Json(name = "hide_viewer_count")
val shouldHideViewerCount: Boolean? = null,

@Json(name = "loop")
val shouldLoop: Boolean? = null,

@Json(name = "byline")
val shouldShowName: Boolean? = null,

@Json(name = "playbar")
val shouldShowPlayBar: Boolean? = null,

@Json(name = "playlist")
val shouldShowPlayList: Boolean? = null,

@Json(name = "portrait")
val shouldShowPortrait: Boolean? = null,

@Json(name = "schedule")
val shouldShowSchedule: Boolean? = null,

@Json(name = "show_latest_archived_clip")
val shouldShowLatestVideoPlaceholder: Boolean? = null,

@Json(name = "volume")
val shouldShowVolumeControls: Boolean? = null,

@Json(name = "title")
val shouldShowTitle: Boolean? = null,

@Json(name = "use_color")
val shouldUseCustomColor: Boolean? = null
)
Loading

0 comments on commit a2c9561

Please sign in to comment.