Do not load metadata of videos. Too slow.

This commit is contained in:
2025-12-01 08:54:58 -07:00
parent c601559059
commit 20997473a4

View File

@@ -146,7 +146,7 @@ function build_album_pages {
echo -en "\t\t\t\t<$a href='/$photo'>" >> $subpage echo -en "\t\t\t\t<$a href='/$photo'>" >> $subpage
# Determine what type of media it is, and how to display it. # Determine what type of media it is, and how to display it.
if [[ $photo == *".mp4" ]]; then if [[ $photo == *".mp4" ]]; then
echo -e "\t\t\t\t\t<video width='320px' preload='metadata' controls>" >> $subpage echo -e "\t\t\t\t\t<video width='320px' preload='none' controls>" >> $subpage
echo -e "\t\t\t\t\t\t<source src='/$photo' type=video/mp4>" >> $subpage echo -e "\t\t\t\t\t\t<source src='/$photo' type=video/mp4>" >> $subpage
echo -e "\t\t\t\t\t\tYour browser does not support videos." >> $subpage echo -e "\t\t\t\t\t\tYour browser does not support videos." >> $subpage
echo -e "\t\t\t\t\t</video>" >> $subpage echo -e "\t\t\t\t\t</video>" >> $subpage
@@ -233,7 +233,7 @@ function build_all_page {
# Determine how to show the file. # Determine how to show the file.
if [[ $media_uri == *".mp4" ]]; then if [[ $media_uri == *".mp4" ]]; then
media="<video style='width:100%' preload='metadata' controls>" media="<video style='width:100%' preload='none' controls>"
media="${media}<source src='$media_uri' type=video/mp4>" media="${media}<source src='$media_uri' type=video/mp4>"
media="${media}Your browser does not support videos." media="${media}Your browser does not support videos."
media="${media}</video>" media="${media}</video>"