diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video-streaming-playlist.ts | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/server/models/video/video-streaming-playlist.ts b/server/models/video/video-streaming-playlist.ts index f587989dc..2b6771f27 100644 --- a/server/models/video/video-streaming-playlist.ts +++ b/server/models/video/video-streaming-playlist.ts | |||
@@ -245,21 +245,25 @@ export class VideoStreamingPlaylistModel extends Model<Partial<AttributesOnly<Vi | |||
245 | } | 245 | } |
246 | 246 | ||
247 | getMasterPlaylistUrl (video: MVideo) { | 247 | getMasterPlaylistUrl (video: MVideo) { |
248 | if (this.storage === VideoStorage.OBJECT_STORAGE) { | 248 | if (video.isOwned()) { |
249 | return getHLSPublicFileUrl(this.playlistUrl) | 249 | if (this.storage === VideoStorage.OBJECT_STORAGE) { |
250 | } | 250 | return getHLSPublicFileUrl(this.playlistUrl) |
251 | } | ||
251 | 252 | ||
252 | if (video.isOwned()) return WEBSERVER.URL + this.getMasterPlaylistStaticPath(video.uuid) | 253 | return WEBSERVER.URL + this.getMasterPlaylistStaticPath(video.uuid) |
254 | } | ||
253 | 255 | ||
254 | return this.playlistUrl | 256 | return this.playlistUrl |
255 | } | 257 | } |
256 | 258 | ||
257 | getSha256SegmentsUrl (video: MVideo) { | 259 | getSha256SegmentsUrl (video: MVideo) { |
258 | if (this.storage === VideoStorage.OBJECT_STORAGE) { | 260 | if (video.isOwned()) { |
259 | return getHLSPublicFileUrl(this.segmentsSha256Url) | 261 | if (this.storage === VideoStorage.OBJECT_STORAGE) { |
260 | } | 262 | return getHLSPublicFileUrl(this.segmentsSha256Url) |
263 | } | ||
261 | 264 | ||
262 | if (video.isOwned()) return WEBSERVER.URL + this.getSha256SegmentsStaticPath(video.uuid, video.isLive) | 265 | return WEBSERVER.URL + this.getSha256SegmentsStaticPath(video.uuid) |
266 | } | ||
263 | 267 | ||
264 | return this.segmentsSha256Url | 268 | return this.segmentsSha256Url |
265 | } | 269 | } |
@@ -287,9 +291,7 @@ export class VideoStreamingPlaylistModel extends Model<Partial<AttributesOnly<Vi | |||
287 | return join(STATIC_PATHS.STREAMING_PLAYLISTS.HLS, videoUUID, this.playlistFilename) | 291 | return join(STATIC_PATHS.STREAMING_PLAYLISTS.HLS, videoUUID, this.playlistFilename) |
288 | } | 292 | } |
289 | 293 | ||
290 | private getSha256SegmentsStaticPath (videoUUID: string, isLive: boolean) { | 294 | private getSha256SegmentsStaticPath (videoUUID: string) { |
291 | if (isLive) return join('/live', 'segments-sha256', videoUUID) | ||
292 | |||
293 | return join(STATIC_PATHS.STREAMING_PLAYLISTS.HLS, videoUUID, this.segmentsSha256Filename) | 295 | return join(STATIC_PATHS.STREAMING_PLAYLISTS.HLS, videoUUID, this.segmentsSha256Filename) |
294 | } | 296 | } |
295 | } | 297 | } |