Skip to content

Commit

Permalink
Version 229:
Browse files Browse the repository at this point in the history
* Fixed a bug where the wrong video frame was shown if you were using the HTML5 video player and digitally zoomed in while the player was paused.
* Added "Renderer" row to Stats for nerds when using the HTML5 video player.  It shows whether the native HTML5 video element is being used or the canvas.
  • Loading branch information
bp2008 committed Feb 6, 2023
1 parent c3ca1b6 commit 747064d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui3.htm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
};
</script>
<script type="text/javascript">
var ui_version = "228";
var ui_version = "229";
var bi_version = "%%VERSION%%";
var appPath_raw = "%%VIRTDIR%%";
var local_bi_session = "%%SESSION%%";
Expand Down
16 changes: 15 additions & 1 deletion ui3/ui3.js
Original file line number Diff line number Diff line change
Expand Up @@ -16255,6 +16255,8 @@ function FetchH264VideoModule()
nerdStats.UpdateStat("Network Delay", netDelay, netDelay.toFixed().padLeft(4, '0') + "ms", true);
nerdStats.UpdateStat("Player Delay", decoderDelay, decoderDelay.toFixed().padLeft(4, '0') + "ms", true);
nerdStats.UpdateStat("Delayed Frames", h264_player.GetBufferedFrameCount(), h264_player.GetBufferedFrameCount(), true);
if (h264_player.isMsePlayer)
h264_player.UpdateNerdStats();
lastNerdStatsUpdate = performance.now();
nerdStats.EndUpdate();
}
Expand Down Expand Up @@ -17490,6 +17492,7 @@ function HTML5_MSE_Player(frameRendered, PlaybackReachedNaturalEndCB, playerErro
var nonKeyframeDropper = new NonKeyframeDropper();
var isRenderingToCanvas = null;
var disableRenderingStateChangesUntilNextFrame = false;
var aFrameWasOnceRendered = false; // Set = true when the first frame is rendered. Never reset to false.

var lastFrame;
var lastFrameDuration = 16;
Expand Down Expand Up @@ -17526,6 +17529,7 @@ function HTML5_MSE_Player(frameRendered, PlaybackReachedNaturalEndCB, playerErro
meta.height = h;
meta.timestamp = meta.time;
finishedFrameCount++;
aFrameWasOnceRendered = true;
timestampLastRenderedFrame = meta.timestamp;
frameRendered(meta);
CheckStreamEndCondition();
Expand Down Expand Up @@ -17924,7 +17928,7 @@ function HTML5_MSE_Player(frameRendered, PlaybackReachedNaturalEndCB, playerErro
{
// Turn on canvas rendering
// Copy current video frame, if possible.
if (finishedFrameCount > 0)
if (aFrameWasOnceRendered)
videoModulesShared.RenderVideoFrame(player);
$("#videoElement_wrapper").addClass('deactivated'); // Hide <video>
videoModulesShared.Get$Canvas().removeClass('deactivated'); // Show <canvas>
Expand All @@ -17937,6 +17941,15 @@ function HTML5_MSE_Player(frameRendered, PlaybackReachedNaturalEndCB, playerErro
}
}
isRenderingToCanvas = enable;
self.UpdateNerdStats();
}
this.getCanvasRenderingState = function ()
{
return isRenderingToCanvas;
}
this.UpdateNerdStats = function ()
{
nerdStats.UpdateStat("Renderer", isRenderingToCanvas ? "<canvas>" : "Native HTML5 <video>");
}

Initialize();
Expand Down Expand Up @@ -28776,6 +28789,7 @@ function UI3NerdStats()
, "Seek Position"
, "Frame Time"
, "Stream Timestamp"
, "Renderer"
, "Codecs"
, "Video Bit Rate"
, "Audio Bit Rate"
Expand Down

0 comments on commit 747064d

Please sign in to comment.