mirror of https://github.com/Chocobozzz/PeerTube
Use HLS by default if enabled
parent
39e6a5cbec
commit
6565916605
|
@ -52,4 +52,8 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
|
|||
getHlsPlaylist () {
|
||||
return this.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS)
|
||||
}
|
||||
|
||||
hasHlsPlaylist () {
|
||||
return !!this.getHlsPlaylist()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -423,7 +423,15 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
}
|
||||
|
||||
const mode: PlayerMode = urlOptions.playerMode === 'p2p-media-loader' ? 'p2p-media-loader' : 'webtorrent'
|
||||
let mode: PlayerMode
|
||||
|
||||
if (urlOptions.playerMode) {
|
||||
if (urlOptions.playerMode === 'p2p-media-loader') mode = 'p2p-media-loader'
|
||||
else mode = 'webtorrent'
|
||||
} else {
|
||||
if (this.video.hasHlsPlaylist()) mode = 'p2p-media-loader'
|
||||
else mode = 'webtorrent'
|
||||
}
|
||||
|
||||
if (mode === 'p2p-media-loader') {
|
||||
const hlsPlaylist = this.video.getHlsPlaylist()
|
||||
|
|
Loading…
Reference in New Issue