diff --git a/frontend/js/integrations/search.js b/frontend/js/integrations/search.js index 994f46c82..30b5e0e31 100644 --- a/frontend/js/integrations/search.js +++ b/frontend/js/integrations/search.js @@ -161,6 +161,9 @@ define([ )); videos.sort( util.lexicographic([ + util.firstWith( + _.property("master") + ), util.firstWith(_.compose( RegExp.prototype.test.bind(/composite\/.*/), _.property("type") diff --git a/frontend/js/player-adapter-html5.js b/frontend/js/player-adapter-html5.js index c06fab055..a2d4e75ec 100644 --- a/frontend/js/player-adapter-html5.js +++ b/frontend/js/player-adapter-html5.js @@ -85,7 +85,6 @@ define( window.Hls = Hls; mediaElementPlayer = new mejs.MediaElementPlayer(targetElement, { - renderers: ["html5", "native_hls"], alwaysShowControls: true, autoRewind: false, stretching: "fill", @@ -96,7 +95,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; } @@ -107,6 +106,7 @@ define( // If duration is valid, we changed status self.status = PlayerAdapter.STATUS.PAUSED; self.dispatchEvent(new Event(PlayerAdapter.EVENTS.READY)); + mediaElementPlayer.updateDuration(); if (self.waitToPlay) { self.play();