lib/testcentricity_web/web_elements/media.rb
def track_data(track)
      obj, = find_element(visible = :all)
      object_not_found_exception(obj, @type)
      track_mode = page.execute_script("return arguments[0].textTracks[#{track - 1}].mode", obj)
      track_obj = obj.find(:css, "track:nth-of-type(#{track})", visible: :all, wait: 1)
      {
        kind: track_obj[:kind],
        label: track_obj[:label],
        language: track_obj[:srclang],
        mode: track_mode
      }
    end
# Return properties of specified text track of associated media
#
# @param track [Integer] index of requested track
# @return [Hash] properties of requested text track (:kind, :label, :language, :mode)
# @example
#   track_info = media_player.track_data(1)
#
Return properties of specified text track of associated media
Return properties of specified text track of associated media
def track_data(track)
      obj, = find_element(visible = :all)
      object_not_found_exception(obj, @type)
      track_mode = page.execute_script("return arguments[0].textTracks[#{track - 1}].mode", obj)
      track_obj = obj.find(:css, "track:nth-of-type(#{track})", visible: :all, wait: 1)
      {
        kind: track_obj[:kind],
        label: track_obj[:label],
        language: track_obj[:srclang],
        mode: track_mode
      }
    end
def track_data ( track ) obj , = find_element ( visible = :all ) object_not_found_exception ( obj , @type ) track_mode = page . execute_script ( "return arguments[0].textTracks[#{track - 1}].mode" , obj ) track_obj = obj . find ( :css , "track:nth-of-type(#{track})" , visible : :all , wait : 1 ) { kind : track_obj [ :kind ] , label : track_obj [ :label ] , language : track_obj [ :srclang ] , mode : track_mode } end
Return properties of specified text track of associated media
Return properties of specified text track of associated media
properties of requested text track (:kind, :label, :language, :mode)
properties of requested text track ( : kind : label : language : mode )
Hash
track
index of requested track
index of requested track
example
track_info = media_player.track_data(1)
track_info = media_player . track_data ( 1 )