Package com.github.twitch4j.kraken.util
Class KrakenVideoHelper
java.lang.Object
com.github.twitch4j.kraken.util.KrakenVideoHelper
Deprecated.
Kraken is deprecated and has been shut down on Febuary 28, 2022.
More details about the deprecation are available here.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Deprecated.Max size of a video part byte array; avoids hitting 25MB.static final int
Deprecated.Minimum size of a video part byte array, 5 MiB. -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<KrakenVideo>
uploadVideo
(@NonNull TwitchKraken api, String authToken, String channelId, @NonNull String title, String description, String game, String language, List<String> tags, String viewable, Instant viewableAt, @NonNull InputStream inputStream, int pieceLength, long sleepBetweenRequests) Deprecated.Uploads a video to the channel of an affiliate or partner.
-
Field Details
-
MAX_PIECE_LENGTH
public static final int MAX_PIECE_LENGTHDeprecated.Max size of a video part byte array; avoids hitting 25MB.This is conservatively set to just over 18 MiB based on testing which values avoid peer connection resets.
- See Also:
-
MIN_PIECE_LENGTH
public static final int MIN_PIECE_LENGTHDeprecated.Minimum size of a video part byte array, 5 MiB.- See Also:
-
-
Method Details
-
uploadVideo
public static CompletableFuture<KrakenVideo> uploadVideo(@NonNull @NonNull TwitchKraken api, String authToken, String channelId, @NonNull @NonNull String title, String description, String game, String language, List<String> tags, String viewable, Instant viewableAt, @NonNull @NonNull InputStream inputStream, int pieceLength, long sleepBetweenRequests) Deprecated.Uploads a video to the channel of an affiliate or partner.Helper function to automate the process of creating the video, uploading the parts, and marking the upload as complete.
Videos with the following formats can be uploaded:
- MP4, MOV, AVI and FLV file formats
- AAC audio
- h264 codec
- Up to 10Mbps bitrate
- Up to 1080p/60FPS
- Parameters:
api
- Required: ATwitchKraken
instance.authToken
- Required: Auth Token (scope: channel_editor) that is authorized to upload to the specified channel.channelId
- Optional: The id of the channel to upload to. If absent, it will use the user id associated with the auth token.title
- Required: The title for the uploaded video (maximum 100 characters).description
- Optional: A short description for the video.game
- Optional: The name of the game in the video.language
- Optional: Language of the video (for example, en).tags
- Optional: Tags describing the video. Maximum: 100 characters per tag, 500 characters for the entire list.viewable
- Optional: Specifies who can view the video. Valid values: public or private. Default: public.viewableAt
- Optional: Date when the video will become public (if initially private).inputStream
- Required: The stream of bytes containing the video. Must be encoded in a format supported by Twitch.pieceLength
- Optional: The number of bytes of video for each video part to be uploaded. Invalid values will be clamped into the valid range.sleepBetweenRequests
- Optional: The time to sleep after each video part upload. Invalid values will be treated as zero.- Returns:
- a future wrapper around the uploaded video
- See Also:
-