Class Stream

java.lang.Object
com.github.twitch4j.helix.domain.Stream

public class Stream extends Object
Stream (LiveStream)
  • Constructor Details

    • Stream

      public Stream()
  • Method Details

    • getUptime

      public Duration getUptime()
      Gets the stream uptime based on the start date.
      Returns:
      The stream uptime.
    • getThumbnailUrl

      public String getThumbnailUrl(int width, int height)
      Gets the thumbnail url for specific dimensions
      Parameters:
      width - thumbnail width
      height - thumbnail height
      Returns:
      populated thumbnail url for a specific resolution
    • getThumbnailUrl

      @NonNull @Deprecated @ScheduledForRemoval(inVersion="2.0.0") public @NonNull String getThumbnailUrl()
      Returns:
      the thumbnail url template
    • getStartedAt

      @Deprecated @ScheduledForRemoval(inVersion="2.0.0") public Calendar getStartedAt()
      Deprecated.
      in favor of getStartedAtInstant()
      Returns:
      the timestamp on when the stream started, in the system default zone
    • getId

      @NonNull public @NonNull String getId()
      Stream ID.
    • getUserId

      @NonNull public @NonNull String getUserId()
      ID of the user who is streaming.
    • getUserLogin

      @NonNull public @NonNull String getUserLogin()
      Login of the user who is streaming.
    • getUserName

      @NonNull public @NonNull String getUserName()
      Display name of the user who is streaming
    • getGameId

      public String getGameId()
      ID of the game being played on the stream.
    • getGameName

      public String getGameName()
      Name of the game being played.
    • getCommunityIds

      @Deprecated @Nullable public @Nullable List<UUID> getCommunityIds()
      Deprecated.
      Array of community IDs.
    • getType

      @NonNull public @NonNull String getType()
      Stream type: "live" or "" (in case of error).
    • getTitle

      @NonNull public @NonNull String getTitle()
      Stream title.
    • getTags

      public List<String> getTags()
      The tags applied to the stream.
    • getViewerCount

      @NonNull public @NonNull Integer getViewerCount()
      Number of viewers watching the stream at the time of the query.
    • getStartedAtInstant

      @NonNull public @NonNull Instant getStartedAtInstant()
      UTC timestamp on when the stream started
    • getTagIds

      @Deprecated @Nullable public @Nullable List<UUID> getTagIds()
      Deprecated.
      Twitch has deprecated tag ids in favor of getTags() due to the latest custom tags system
      Ids of active tags on the stream
      See Also:
    • isMature

      public Boolean isMature()
      Indicates if the broadcaster has specified their channel contains mature content that may be inappropriate for younger audiences.
    • getLanguage

      @NonNull public @NonNull String getLanguage()
      Stream language.
    • getThumbnailUrlTemplate

      @NonNull public @NonNull String getThumbnailUrlTemplate()
      A template URL to an image of a frame from the last 5 minutes of the stream. Contains "{width}" and "{height}" placeholders to obtain the size of the image you want, in pixels.

      To obtain a populated URL, prefer calling getThumbnailUrl(int, int) instead.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object