Module: BBC::Redux::EndPoints

Defined in:
lib/bbc/redux/end_points.rb

Constant Summary collapse

HOST =
'https://i.bbcredux.com'

Class Method Summary collapse

Class Method Details

.dvbsubs(id, key, fname = nil) ⇒ String

Make dvb subs media file end point

Parameters:

  • id (String)

    asset identifier

  • key (String)

    string value of a valid access key

  • fname (String) (defaults to: nil)

    template for the file name

Returns:

  • (String)

    The end point



14
15
16
# File 'lib/bbc/redux/end_points.rb', line 14

def self.dvbsubs(id, key, fname = nil)
  HOST + "/asset/media/#{id}/#{key}/dvbsubs/#{(fname || '%s.xml') % id}"
end

.flv(id, key, fname = nil) ⇒ String

Make FLV media file end point

Parameters:

  • id (String)

    asset identifier

  • key (String)

    string value of a valid access key

  • fname (String) (defaults to: nil)

    template for the file name

Returns:

  • (String)

    The end point



23
24
25
# File 'lib/bbc/redux/end_points.rb', line 23

def self.flv(id, key, fname = nil)
  HOST + "/asset/media/#{id}/#{key}/Flash_v1.0/#{(fname || '%s.flv') % id}"
end

.h264_hi(id, key, fname = nil) ⇒ String

Make h264_hi media file end point

Parameters:

  • id (String)

    asset identifier

  • key (String)

    string value of a valid access key

  • fname (String) (defaults to: nil)

    template for the file name

Returns:

  • (String)

    The end point



41
42
43
44
# File 'lib/bbc/redux/end_points.rb', line 41

def self.h264_hi(id, key, fname = nil)
  HOST + "/asset/media/#{id}/#{key}/h264_mp4_hi_v1.1/" \
       + (fname || '%s-h264lg.mp4') % id
end

.h264_lo(id, key, fname = nil) ⇒ String

Make h264_lo media file end point

Parameters:

  • id (String)

    asset identifier

  • key (String)

    string value of a valid access key

  • fname (String) (defaults to: nil)

    template for the file name

Returns:

  • (String)

    The end point



51
52
53
54
# File 'lib/bbc/redux/end_points.rb', line 51

def self.h264_lo(id, key, fname = nil)
  HOST + "/asset/media/#{id}/#{key}/h264_mp4_lo_v1.0/" \
       + (fname || '%s-h264sm.mp4') % id
end

.mp3(id, key, fname = nil) ⇒ String

Make mp3 media file end point

Parameters:

  • id (String)

    asset identifier

  • key (String)

    string value of a valid access key

  • fname (String) (defaults to: nil)

    template for the file name

Returns:

  • (String)

    The end point



32
33
34
# File 'lib/bbc/redux/end_points.rb', line 32

def self.mp3(id, key, fname = nil)
  HOST + "/asset/media/#{id}/#{key}/MP3_v1.0/#{(fname || '%s.mp3') % id}"
end

.ts(id, key, fname = nil) ⇒ String

Make ts media file end point

Parameters:

  • id (String)

    asset identifier

  • key (String)

    string value of a valid access key

  • fname (String) (defaults to: nil)

    template for the file name

Returns:

  • (String)

    The end point



61
62
63
# File 'lib/bbc/redux/end_points.rb', line 61

def self.ts(id, key, fname = nil)
  HOST + "/asset/media/#{id}/#{key}/ts/#{(fname || '%s.mpegts') % id}"
end

.ts_stripped(id, key, fname = nil) ⇒ String

Make stripped ts media file end point

Parameters:

  • id (String)

    asset identifier

  • key (String)

    string value of a valid access key

  • fname (String) (defaults to: nil)

    template for the file name

Returns:

  • (String)

    The end point



70
71
72
73
# File 'lib/bbc/redux/end_points.rb', line 70

def self.ts_stripped(id, key, fname = nil)
  HOST + "/asset/media/#{id}/#{key}/strip/" \
       + (fname || '%s-stripped.mpegts') % id
end