e81de1a7 by David LaPalomento

Remove getCurrentTimeByMediaIndex_

This function was obsoleted by Playlist.duration() and unused.
1 parent 6f177803
...@@ -1151,30 +1151,6 @@ videojs.Hls.getMediaIndexByTime = function() { ...@@ -1151,30 +1151,6 @@ videojs.Hls.getMediaIndexByTime = function() {
1151 }; 1151 };
1152 1152
1153 /** 1153 /**
1154 * Determine the current time in seconds in one playlist by a media index. This
1155 * function iterates through the segments of a playlist up to the specified index
1156 * and then returns the time up to that point.
1157 *
1158 * @param playlist {object} The playlist of the segments being searched.
1159 * @param mediaIndex {number} The index of the target segment in the playlist.
1160 * @returns {number} The current time to that point, or 0 if none appropriate.
1161 */
1162 videojs.Hls.prototype.getCurrentTimeByMediaIndex_ = function(playlist, mediaIndex) {
1163 var index, time = 0, segment;
1164
1165 if (!playlist.segments || mediaIndex === 0) {
1166 return 0;
1167 }
1168
1169 for (index = 0; index < mediaIndex; index++) {
1170 segment = playlist.segments[index];
1171 time += segment.preciseDuration || segment.duration || playlist.targetDuration || 0;
1172 }
1173
1174 return time;
1175 };
1176
1177 /**
1178 * A comparator function to sort two playlist object by bandwidth. 1154 * A comparator function to sort two playlist object by bandwidth.
1179 * @param left {object} a media playlist object 1155 * @param left {object} a media playlist object
1180 * @param right {object} a media playlist object 1156 * @param right {object} a media playlist object
......