File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -102,13 +102,14 @@ shaka.media.RegionTimeline = class extends shaka.util.FakeEventTarget {
102102 * @private
103103 */
104104 findSimilarRegion_ ( region ) {
105+ const isDiffNegligible = ( a , b ) => Math . abs ( a - b ) < 0.1 ;
105106 for ( const existing of this . regions_ ) {
106107 // The same scheme ID and time range means that it is similar-enough to
107108 // be the same region.
108109 const isSimilar = existing . schemeIdUri == region . schemeIdUri &&
109- existing . id == region . id &&
110- existing . startTime == region . startTime &&
111- existing . endTime == region . endTime ;
110+ existing . id == region . id &&
111+ isDiffNegligible ( existing . startTime , region . startTime ) &&
112+ isDiffNegligible ( existing . endTime , region . endTime ) ;
112113
113114 if ( isSimilar ) {
114115 return existing ;
You can’t perform that action at this time.
0 commit comments