@@ -3,7 +3,7 @@ import type { IVideoRepresentation } from "../../../../src/public_types";
33import capitalizeFirstLetter from "../lib/capitalizeFirstLetter" ;
44import shuffleArray from "../lib/shuffleArray" ;
55import ToolTip from "./ToolTip" ;
6- import { IBufferedChunkSnapshot } from "../../../../src/core/segment_sinks/segment_buffers_store " ;
6+ import { IBufferedData } from "../modules/player " ;
77
88const { useEffect, useMemo, useRef, useState } = React ;
99
@@ -68,7 +68,7 @@ function paintCurrentPosition(
6868interface IScaledBufferedData {
6969 scaledStart : number ;
7070 scaledEnd : number ;
71- bufferedInfos : IBufferedChunkSnapshot ;
71+ bufferedInfos : IBufferedData ;
7272}
7373
7474/**
@@ -80,7 +80,7 @@ interface IScaledBufferedData {
8080 * @returns {Array.<Object> }
8181 */
8282function scaleSegments (
83- bufferedData : IBufferedChunkSnapshot [ ] ,
83+ bufferedData : IBufferedData [ ] ,
8484 minimumPosition : number ,
8585 maximumPosition : number ,
8686) : IScaledBufferedData [ ] {
@@ -123,7 +123,7 @@ export default function BufferContentGraph({
123123 type, // The type of buffer (e.g. "audio", "video" or "text")
124124} : {
125125 currentTime : number | undefined ;
126- data : IBufferedChunkSnapshot [ ] ;
126+ data : IBufferedData [ ] ;
127127 minimumPosition : number | null | undefined ;
128128 maximumPosition : number | null | undefined ;
129129 seek : ( pos : number ) => void ;
@@ -134,7 +134,7 @@ export default function BufferContentGraph({
134134 const [ tipPosition , setTipPosition ] = useState ( 0 ) ;
135135 const [ tipText , setTipText ] = useState ( "" ) ;
136136 const canvasEl = useRef < HTMLCanvasElement > ( null ) ;
137- const representationsIdEncountered = useRef < string [ ] > ( [ ] ) ;
137+ const representationsIdEncountered = useRef < ( string | number ) [ ] > ( [ ] ) ;
138138 const usedMaximum = maximumPosition ?? 300 ;
139139 const usedMinimum = minimumPosition ?? 0 ;
140140 const duration = Math . max ( usedMaximum - usedMinimum , 0 ) ;
@@ -148,11 +148,9 @@ export default function BufferContentGraph({
148148 const paintSegment = React . useCallback (
149149 ( scaledSegment : IScaledBufferedData , canvasCtx : CanvasRenderingContext2D ) : void => {
150150 const representation = scaledSegment . bufferedInfos . infos . representation ;
151- let indexOfRepr = representationsIdEncountered . current . indexOf (
152- representation . uniqueId ,
153- ) ;
151+ let indexOfRepr = representationsIdEncountered . current . indexOf ( representation . id ) ;
154152 if ( indexOfRepr < 0 ) {
155- representationsIdEncountered . current . push ( representation . uniqueId ) ;
153+ representationsIdEncountered . current . push ( representation . id ) ;
156154 indexOfRepr = representationsIdEncountered . current . length - 1 ;
157155 }
158156 const colorIndex = indexOfRepr % COLORS . length ;
@@ -255,7 +253,7 @@ export default function BufferContentGraph({
255253 "\n" +
256254 `height: ${ rep . height ?? "?" } ` +
257255 "\n" +
258- `codec: ${ representation . codecs ?. join ( "-" ) ?? "?" } ` +
256+ `codec: ${ representation . codec ?? representation . codecs ?. join ( "-" ) ?? "?" } ` +
259257 "\n" +
260258 `bitrate: ${ representation . bitrate ?? "?" } ` +
261259 "\n" ;
@@ -267,7 +265,7 @@ export default function BufferContentGraph({
267265 "\n" +
268266 `audioDescription: ${ String ( adaptation . isAudioDescription ) ?? false } ` +
269267 "\n" +
270- `codec: ${ representation . codecs ?. join ( "-" ) ?? "?" } ` +
268+ `codec: ${ representation . codec ?? representation . codecs ?. join ( "-" ) ?? "?" } ` +
271269 "\n" +
272270 `bitrate: ${ representation . bitrate ?? "?" } ` +
273271 "\n" ;
0 commit comments