lib/testcentricity_web/web_elements/media.rb
def active_track
      num_tracks = track_count
      return 0 if num_tracks.zero?

      obj, = find_element(visible = :all)
      object_not_found_exception(obj, @type)
      (0..num_tracks).each do |track|
        track_info = page.execute_script("return arguments[0].textTracks[#{track}].mode", obj)
        return track + 1 if track_info == 'showing'
      end
      0
    end
# Return index of active text track of associated media
#
# @return [Integer] number of active text track
# @example
#   track_num = media_player.active_track
#
Return index of active text track of associated media
Return index of active text track of associated media
def active_track
      num_tracks = track_count
      return 0 if num_tracks.zero?
      obj, = find_element(visible = :all)
      object_not_found_exception(obj, @type)
      (0..num_tracks).each do |track|
        track_info = page.execute_script("return arguments[0].textTracks[#{track}].mode", obj)
        return track + 1 if track_info == 'showing'
      end
      0
    end
def active_track num_tracks = track_count return 0 if num_tracks . zero? obj , = find_element ( visible = :all ) object_not_found_exception ( obj , @type ) ( 0 .. num_tracks ) . each do | track | track_info = page . execute_script ( "return arguments[0].textTracks[#{track}].mode" , obj ) return track + 1 if track_info == 'showing' end 0 end
Return index of active text track of associated media
Return index of active text track of associated media
number of active text track
number of active text track
Integer
example
None