Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Correctly sort video file resolutions

Chocobozzz3648342d1335
diff --git a/client/src/app/shared/shared-main/video/video-details.model.ts b/client/src/app/shared/shared-main/video/video-details.model.ts
index 5f13e7a450..0ca12a9bd7 100644
--- a/client/src/app/shared/shared-main/video/video-details.model.ts
+++ b/client/src/app/shared/shared-main/video/video-details.model.ts
@@ -12,6 +12,7 @@ import {
VideoStreamingPlaylistType
} from '@peertube/peertube-models'
import { Video } from './video.model'
+import { sortBy } from '@peertube/peertube-core-utils'
export class VideoDetails extends Video implements VideoDetailsServerModel {
declare channel: VideoChannel
@@ -75,7 +76,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
}
// Try to find the best video file to download
- // It builds an array and prioritises web videos that play on more third-party players.
+ // It builds an array and prioritizes web videos that play on more third-party players.
getFilesForDownload () {
const store = this.files
@@ -85,6 +86,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
}
}
- return store
+ return sortBy(store, 'resolution', 'id').reverse()
}
}