Module: Airplay::Playable

Included in:
Device
Defined in:
lib/airplay/playable.rb

Instance Method Summary collapse

Instance Method Details

#play(file_or_url = "playlist", options = {}) ⇒ Object

Public: Plays a given video

file_or_url - The video to be played options - Optional start position

Returns a Player object to control the playback



12
13
14
15
# File 'lib/airplay/playable.rb', line 12

def play(file_or_url = "playlist", options = {})
  player.async.play(file_or_url, options)
  player
end

#playerObject

Public: Gets the player object

Returns a Player object



36
37
38
# File 'lib/airplay/playable.rb', line 36

def player
  @_player ||= Airplay::Player.new(self)
end

#playlistObject

Public: Gets the current playlist

Returns the Playlist



21
22
23
# File 'lib/airplay/playable.rb', line 21

def playlist
  player.playlist
end

#playlistsObject

Public: Gets all the playlists

Returns the Playlists



29
30
31
# File 'lib/airplay/playable.rb', line 29

def playlists
  player.playlists
end