Skip to content

Commit

Permalink
Version 240:
Browse files Browse the repository at this point in the history
* The relatively new "screen keepalive" feature now knows how to circumvent most popular browser extensions that prevent video autoplay by breaking the video playback API.
  * Uses the same wrapper code that UI3 has had for years.
  • Loading branch information
bp2008 committed May 8, 2023
1 parent c498add commit a26ef47
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 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 = "239";
var ui_version = "240";
var bi_version = "%%VERSION%%";
var appPath_raw = "%%VIRTDIR%%";
var local_bi_session = "%%SESSION%%";
Expand Down
5 changes: 3 additions & 2 deletions ui3/libs-src/NoSleep.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ var NoSleep = function () {
_classCallCheck(this, NoSleep);

this.options = Object.assign({
allowNativeWakeLock: true
allowNativeWakeLock: true,
overridePlayFunc: null
}, options);
this.title = "No sleep";
this.enabled = false;
Expand Down Expand Up @@ -229,7 +230,7 @@ var NoSleep = function () {
this.enabled = true;
return Promise.resolve();
} else {
var playPromise = this.noSleepVideo.play();
var playPromise = this.options.overridePlayFunc ? this.options.overridePlayFunc(this.noSleepVideo) : this.noSleepVideo.play();
return playPromise.then(function (res) {
_this2.enabled = true;
return res;
Expand Down
2 changes: 1 addition & 1 deletion ui3/libs-src/NoSleep.min.js

Large diffs are not rendered by default.

Binary file modified ui3/libs-src/nosleep.js.7z
Binary file not shown.
2 changes: 1 addition & 1 deletion ui3/libs-ui3.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions ui3/ui3.js
Original file line number Diff line number Diff line change
Expand Up @@ -19712,9 +19712,10 @@ function KeepScreenAlive()
{
var self = this;
var noSleep;
var badAutoplay = new BadAutoplayPreventionDetector();
try
{
noSleep = new NoSleep({ allowNativeWakeLock: false });
noSleep = new NoSleep({ allowNativeWakeLock: false, overridePlayFunc: function (player) { return badAutoplay.Play(player); } });
if (noSleep.noSleepVideo)
$(noSleep.noSleepVideo).css("top", "0px")
.css("left", "0px")
Expand Down Expand Up @@ -32616,7 +32617,7 @@ function SysNameToAppName(sysName)
sysName = sysName ? sysName.trim() : "";
if (sysName == "")
return "Blue Iris UI3";
if (sysName.match(/\b(Blue Iris|BI|UI3)\b/i))
if (sysName.match(/\b(Blue Iris|BlueIris|BI|UI3)\b/i))
return sysName;
if (sysName.length <= 13)
return sysName + " UI3";
Expand Down

0 comments on commit a26ef47

Please sign in to comment.