Class: Twitch::V2::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/kappa/stream.rb

Overview

Streams are video broadcasts that are currently live. They belong to a user and are part of a channel.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#broadcasterString (readonly)

Deprecated.

This attribute is not present in the V3 API.

Returns The broadcasting software used for this stream.

Examples:

"fme", "xsplit", "obs", "rebroadcast", "delay", "unknown rtmp"

Returns:

  • (String)

    The broadcasting software used for this stream.



42
43
44
# File 'lib/kappa/stream.rb', line 42

def broadcaster
  @broadcaster
end

#channelChannel (readonly)

Note:

This does not incur any web requests.

Returns The Channel associated with this stream.

Returns:

  • (Channel)

    The Channel associated with this stream.



66
67
68
# File 'lib/kappa/stream.rb', line 66

def channel
  @channel
end

#game_nameString (readonly)

Returns The name of the game currently being streamed.

Examples:

"Super Meat Boy"

Returns:

  • (String)

    The name of the game currently being streamed.



47
48
49
# File 'lib/kappa/stream.rb', line 47

def game_name
  @game_name
end

#idFixnum (readonly)

Returns Unique Twitch ID.

Examples:

6226912672

Returns:

  • (Fixnum)

    Unique Twitch ID.



36
37
38
# File 'lib/kappa/stream.rb', line 36

def id
  @id
end

#nameString (readonly)

Returns The unique Twitch name for this stream.

Examples:

"live_user_lethalfrag"

Returns:

  • (String)

    The unique Twitch name for this stream.



52
53
54
# File 'lib/kappa/stream.rb', line 52

def name
  @name
end

#preview_urlString (readonly)

Returns URL of a preview screenshot taken from the video stream.

Examples:

"http://static-cdn.jtvnw.net/previews-ttv/live_user_lethalfrag-320x200.jpg"

Returns:

  • (String)

    URL of a preview screenshot taken from the video stream.



62
63
64
# File 'lib/kappa/stream.rb', line 62

def preview_url
  @preview_url
end

#urlString (readonly)

Returns The URL for this stream.

Examples:

"http://www.twitch.tv/lethalfrag" 

Returns:

  • (String)

    The URL for this stream.



71
72
73
# File 'lib/kappa/stream.rb', line 71

def url
  @url
end

#viewer_countFixnum (readonly)

Returns The number of viewers currently watching the stream.

Examples:

2342

Returns:

  • (Fixnum)

    The number of viewers currently watching the stream.



57
58
59
# File 'lib/kappa/stream.rb', line 57

def viewer_count
  @viewer_count
end

Instance Method Details

#userUser

Note:

This incurs an additional web request.

Get the owner of this stream.

Returns:

  • (User)

    The user that owns this stream.



29
30
31
# File 'lib/kappa/stream.rb', line 29

def user
  @query.users.get(@channel.name)
end