Class: AccessPage

Inherits:
ServiceCall show all
Defined in:
lib/etvnet_seek/core/access_page.rb

Constant Summary collapse

ACCESS_URL =
Page::BASE_URL + "/cgi-bin/video/access.fcgi"

Instance Attribute Summary

Attributes inherited from ServiceCall

#url

Instance Method Summary collapse

Methods inherited from ServiceCall

#get, #post

Constructor Details

#initializeAccessPage

Returns a new instance of AccessPage.



4
5
6
# File 'lib/etvnet_seek/core/access_page.rb', line 4

def initialize
  super(ACCESS_URL)
end

Instance Method Details

#request_media_info(media_file, cookie) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/etvnet_seek/core/access_page.rb', line 8

def request_media_info media_file, cookie
  params = { 'action' => 'start_video', 'bitrate' => '600',
             'media_file'=> media_file, 'replay' => '1', 'skin' => 'JSON' }
  headers = { 'Cookie' => cookie }

  response = post(params, headers)

  MediaInfo.new JSON.parse(response.body)["PARAMETERS"]
end