Skip to content

Commit

Permalink
Version 67:
Browse files Browse the repository at this point in the history
* Added device pixel ratio to viewport readout in "Stats for nerds" panel.
* Removed some ES2015 language usage that is not supported in all browsers.
  • Loading branch information
bp2008 committed Feb 26, 2019
1 parent c14f4d4 commit 2d6ec6e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ui3.htm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
};
</script>
<script type="text/javascript">
var ui_version = "66";
var ui_version = "67";
var bi_version = "%%VERSION%%";
var combined_version = ui_version + "-" + bi_version;
//if (!!navigator.userAgent.match(/ Android /))
Expand Down
2 changes: 1 addition & 1 deletion ui3/ui3.css
Original file line number Diff line number Diff line change
Expand Up @@ -4365,7 +4365,7 @@ div::-webkit-scrollbar-corner
display: none !important;
}

.nonMatchingNativeRes
.nonMatchingNativeRes, .dprTag
{
color: #e6e660;
}
15 changes: 10 additions & 5 deletions ui3/ui3.js
Original file line number Diff line number Diff line change
Expand Up @@ -9640,12 +9640,12 @@ function JpegVideoModule()
if (nerdStats.IsOpen())
{
var loaded = videoPlayer.Loaded().image;
let nativeRes = " (Native: " + loading.fullwidth + "x" + loading.fullheight + ")";
var nativeRes = " (Native: " + loading.fullwidth + "x" + loading.fullheight + ")";
if (loading.fullwidth !== loaded.actualwidth || loading.fullheight !== loaded.actualheight)
nativeRes = '<span class="nonMatchingNativeRes">' + nativeRes + '</span>';

nerdStats.BeginUpdate();
nerdStats.UpdateStat("Viewport", $layoutbody.width() + "x" + $layoutbody.height());
nerdStats.UpdateStat("Viewport", null, $layoutbody.width() + "x" + $layoutbody.height() + GetDevicePixelRatioTag());
nerdStats.UpdateStat("Stream Resolution", null, loaded.actualwidth + "x" + loaded.actualheight + nativeRes);
nerdStats.UpdateStat("Seek Position", loading.isLive ? "LIVE" : (parseInt(self.GetSeekPercent() * 100) + "% (Frame Offset: " + Math.floor(clipPlaybackPosition) + "ms)"));
nerdStats.UpdateStat("Codecs", "jpeg");
Expand Down Expand Up @@ -10248,7 +10248,7 @@ function FetchH264VideoModule()
widthAndQualityArg += "&w=" + imageRenderer.GetSizeToRequest(false).w;
widthAndQualityArg += "&q=50";
}
let offsetArg = "";
var offsetArg = "";
if (reqMs !== null)
{
reqMs = Clamp(reqMs, 0, loading.msec - 1);
Expand Down Expand Up @@ -10564,12 +10564,12 @@ function FetchH264VideoModule()
var decoderDelay = h264_player.GetBufferedTime().toFloat();
if (h264_player.isMsePlayer)
interFrame = frame.duration ? frame.duration : 0;
let nativeRes = " (Native: " + loading.fullwidth + "x" + loading.fullheight + ")";
var nativeRes = " (Native: " + loading.fullwidth + "x" + loading.fullheight + ")";
if (loading.fullwidth !== frame.width || loading.fullheight !== frame.height)
nativeRes = '<span class="nonMatchingNativeRes">' + nativeRes + '</span>';

nerdStats.BeginUpdate();
nerdStats.UpdateStat("Viewport", $layoutbody.width() + "x" + $layoutbody.height());
nerdStats.UpdateStat("Viewport", null, $layoutbody.width() + "x" + $layoutbody.height() + GetDevicePixelRatioTag());
nerdStats.UpdateStat("Stream Resolution", null, frame.width + "x" + frame.height + nativeRes);
nerdStats.UpdateStat("Seek Position", (loading.isLive ? "LIVE" : ((frame.pos / 100).toFixed() + "%")) + " (Frame Offset: " + frame.timestamp + "ms)");
nerdStats.UpdateStat("Frame Time", GetDateStr(new Date(frame.utc + GetServerTimeOffset()), true));
Expand Down Expand Up @@ -21383,6 +21383,11 @@ function BI_GetDevicePixelRatio()
returnValue = 1;
return returnValue;
}
function GetDevicePixelRatioTag()
{
var dpr = BI_GetDevicePixelRatio();
return dpr === 1 ? "" : ('<span class="dprTag">*' + dpr.toFloat(2) + '</span>');
}
function BrowserIsChrome()
{
return navigator.appVersion.indexOf(" Chrome/") > -1;
Expand Down

0 comments on commit 2d6ec6e

Please sign in to comment.