chore: small bug fixes

This commit is contained in:
DanCodes committed 2024-01-10 11:01:55 +00:00
1 parent 049e6bb833
commit c5c10bd8cb
9 files changed
+167 -72

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
function getVideoDebugInfo(videoElement: HTMLVideoElement) {
const quality = videoElement.getVideoPlaybackQuality();
const debugInfo = {
droppedFrames: quality.droppedVideoFrames,
totalFrames: quality.totalVideoFrames,
resolution: {
width: videoElement.videoWidth,
height: videoElement.videoHeight,
},
container:
videoElement.currentSrc.split(".").pop()?.split("?").pop() || "unknown",
duration: videoElement.duration,
currentTime: videoElement.currentTime,
playbackRate: videoElement.playbackRate,
volume: videoElement.volume,
currentQuality: {
width: videoElement.videoWidth,
height: videoElement.videoHeight,
},
};
return debugInfo;
}