From a8462c8e3a61f4f7314fe18c0c10cc2946c254d1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 5 Apr 2018 16:15:51 +0200 Subject: Automatic resolution according to user bandwidth V1 --- client/src/app/shared/video/video-details.model.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'client/src/app/shared/video') diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts index 9fc326beb..a1f7207a2 100644 --- a/client/src/app/shared/video/video-details.model.ts +++ b/client/src/app/shared/video/video-details.model.ts @@ -3,8 +3,7 @@ import { VideoChannel, VideoDetails as VideoDetailsServerModel, VideoFile, - VideoPrivacy, - VideoResolution + VideoPrivacy } from '../../../../../shared' import { Account } from '../../../../../shared/models/actors' import { VideoConstant } from '../../../../../shared/models/videos/video.model' @@ -39,21 +38,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { this.buildLikeAndDislikePercents() } - getAppropriateMagnetUri (actualDownloadSpeed = 0) { - if (this.files === undefined || this.files.length === 0) return '' - if (this.files.length === 1) return this.files[0].magnetUri - - // Find first video that is good for our download speed (remember they are sorted) - let betterResolutionFile = this.files.find(f => actualDownloadSpeed > (f.size / this.duration)) - - // If the download speed is too bad, return the lowest resolution we have - if (betterResolutionFile === undefined) { - betterResolutionFile = this.files.find(f => f.resolution.id === VideoResolution.H_240P) - } - - return betterResolutionFile.magnetUri - } - isRemovableBy (user: AuthUser) { return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.REMOVE_ANY_VIDEO)) } -- cgit v1.2.3