From 38692970fd0fd306de30da9bd9317be4872da744 Mon Sep 17 00:00:00 2001 From: Marcus Eibrink-Lunzenauer Date: Wed, 8 May 2024 14:13:03 +0200 Subject: [PATCH] Prefer master tracks and hls and wait for `NaN` and `Infinity`. --- frontend/js/integrations/search.js | 1 + frontend/js/player-adapter-html5.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/js/integrations/search.js b/frontend/js/integrations/search.js index fe64d75a0..004a9fd1a 100644 --- a/frontend/js/integrations/search.js +++ b/frontend/js/integrations/search.js @@ -159,6 +159,7 @@ define([ RegExp.prototype.test.bind(/application\/.*|video\/.*/), _.property("mimetype") )); + videos = _.sortBy(videos, "master").reverse(); videos.sort( util.lexicographic([ util.firstWith(_.compose( diff --git a/frontend/js/player-adapter-html5.js b/frontend/js/player-adapter-html5.js index c06fab055..5658ddae8 100644 --- a/frontend/js/player-adapter-html5.js +++ b/frontend/js/player-adapter-html5.js @@ -85,7 +85,7 @@ define( window.Hls = Hls; mediaElementPlayer = new mejs.MediaElementPlayer(targetElement, { - renderers: ["html5", "native_hls"], + renderers: ["native_hls", "html5"], alwaysShowControls: true, autoRewind: false, stretching: "fill", @@ -96,7 +96,7 @@ define( */ $(mediaElement).on("canplay durationchange", function () { // If duration is still not valid - if (isNaN(self.getDuration()) || mediaElement.readyState < 1) { + if (!isFinite(self.getDuration()) || mediaElement.readyState < 1) { return; }