@@ -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 ) ;
@@ -149,10 +149,10 @@ export default function BufferContentGraph({
149149 ( scaledSegment : IScaledBufferedData , canvasCtx : CanvasRenderingContext2D ) : void => {
150150 const representation = scaledSegment . bufferedInfos . infos . representation ;
151151 let indexOfRepr = representationsIdEncountered . current . indexOf (
152- representation . uniqueId ,
152+ representation . id ,
153153 ) ;
154154 if ( indexOfRepr < 0 ) {
155- representationsIdEncountered . current . push ( representation . uniqueId ) ;
155+ representationsIdEncountered . current . push ( representation . id ) ;
156156 indexOfRepr = representationsIdEncountered . current . length - 1 ;
157157 }
158158 const colorIndex = indexOfRepr % COLORS . length ;
@@ -255,7 +255,7 @@ export default function BufferContentGraph({
255255 "\n" +
256256 `height: ${ rep . height ?? "?" } ` +
257257 "\n" +
258- `codec: ${ representation . codecs ?. join ( "-" ) ?? "?" } ` +
258+ `codec: ${ representation . codec ?? representation . codecs ?. join ( "-" ) ?? "?" } ` +
259259 "\n" +
260260 `bitrate: ${ representation . bitrate ?? "?" } ` +
261261 "\n" ;
@@ -267,7 +267,7 @@ export default function BufferContentGraph({
267267 "\n" +
268268 `audioDescription: ${ String ( adaptation . isAudioDescription ) ?? false } ` +
269269 "\n" +
270- `codec: ${ representation . codecs ?. join ( "-" ) ?? "?" } ` +
270+ `codec: ${ representation . codec ?? representation . codecs ?. join ( "-" ) ?? "?" } ` +
271271 "\n" +
272272 `bitrate: ${ representation . bitrate ?? "?" } ` +
273273 "\n" ;
0 commit comments