Prefer mp4 to m3u8 for Video Playback

This allows video playback without Javascript and when proxying videos
is turned off.
This commit is contained in:
girst 2022-02-25 19:26:24 +01:00
parent ecb6fe4162
commit 19fb6c9e78
2 changed files with 3 additions and 3 deletions

View file

@ -76,8 +76,8 @@ proc parseVideo(js: JsonNode): Video =
views: js{"ext", "mediaStats", "r", "ok", "viewCount"}.getStr,
available: js{"ext_media_availability", "status"}.getStr == "available",
title: js{"ext_alt_text"}.getStr,
durationMs: js{"video_info", "duration_millis"}.getInt
# playbackType: mp4
durationMs: js{"video_info", "duration_millis"}.getInt,
playbackType: mp4
)
with title, js{"additional_media_info", "title"}:

View file

@ -100,7 +100,7 @@ proc renderVideo*(video: Video; prefs: Prefs; path: string): VNode =
renderVideoDisabled(video, path)
else:
let vid = video.variants.filterIt(it.contentType == video.playbackType)
let source = getVidUrl(vid[0].url)
let source = if prefs.proxyVideos: getVidUrl(vid[0].url) else: vid[0].url
case video.playbackType
of mp4:
if prefs.muteVideos: