Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/js/integrations/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ define([
RegExp.prototype.test.bind(/application\/.*|video\/.*/),
_.property("mimetype")
));
videos = _.sortBy(videos, "master").reverse();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we integrate this in the sort below? Something like

videos.sort(
    util.lexicographical([
        util.firstWith(
            _.property("master")
        ),
        // [...]
    ])
);

Should work, but please double-check me on this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I integrated the sort as you suggested. It works: #646

videos.sort(
util.lexicographic([
util.firstWith(_.compose(
Expand Down
4 changes: 2 additions & 2 deletions frontend/js/player-adapter-html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ define(

window.Hls = Hls;
mediaElementPlayer = new mejs.MediaElementPlayer(targetElement, {
renderers: ["html5", "native_hls"],
renderers: ["native_hls", "html5"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary even with the correct sort order of the videos? 🤔

Looking at the docs for this setting I also wonder: Can we get away with not specifying this at all?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the renderers line. I read the documentation and this field doesn't seem mandatory. It still works when I removed it: #646

alwaysShowControls: true,
autoRewind: false,
stretching: "fill",
Expand All @@ -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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't live streams have infinite durations? 🤔 Although to be fair, the rest of the tool can't deal with those, either. x)

Still, I wonder: Did you encounter a case where the duration is infinite first, and then changes to something finite?

Copy link
Member

@marwyg marwyg Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in #646, I didn't see such a case and I cannot say if Marcus did. But I compared in my other PR both functions (isNaN and !isFinite) and I think it should be okay like this.

return;
}

Expand Down