]> git.plutz.net Git - rawnet/commitdiff
video styling (controls, size, etc...)
authorPaul Hänsch <paul@plutz.net>
Thu, 14 Oct 2021 13:44:52 +0000 (15:44 +0200)
committerPaul Hänsch <paul@plutz.net>
Thu, 14 Oct 2021 13:44:52 +0000 (15:44 +0200)
page_channel.sh
page_video.sh
rawnet.css

index bc05b15919fef30dd305de83b8ef7d853f685f79..cc25c27c811b81222fb79da3f4b25d3e37665b5e 100755 (executable)
@@ -166,6 +166,7 @@ w_video(){
            VIDEO_NAME="$(UNSTRING "$VIDEO_NAME")"
     VIDEO_DESCRIPTION="$(UNSTRING "$VIDEO_DESCRIPTION")"
     VIDEO_DESCR_CACHE="$(UNSTRING "$VIDEO_DESCR_CACHE")"
+         VIDEO_LENGTH="$(printf %i "$VIDEO_LENGTH" 2>&-)"
 
     [ "${VIDEO_STATUS}" = public ] || AUTHOR || return 0
 
@@ -181,7 +182,7 @@ w_video(){
             ]' "$_BASE" "$CHANNEL_ID" "$VIDEO_ID" \
                "$(HTML "${VIDEO_NAME:-(Unnamed Video)}")" \
                "$thumb" \
-               "$((${VIDEO_LENGTH%.*} / 60))" "$((${VIDEO_LENGTH%.*} % 60))" \
+               "$((VIDEO_LENGTH / 60))" "$((VIDEO_LENGTH % 60))" \
                "$(UNSTRING "$DESCR_CACHE")"
   else
     return 1
index b7b9953787d44effcf2913027ab5ab0b0a3f3ff5..fc1d358d6486fab7ebd424e401a7c6baf551d545 100644 (file)
@@ -255,9 +255,9 @@ elif [ "$channel" -a "$video" ]; then
          ]
        ]')
        $( [ $VIDEO_STATUS != void ] && printf '
-       [video
-         [source src="%s/video/%s/%s.mp4"]
-       ]' "$_BASE" "$channel" "$video"
+       [video preload=none controls=controls width=%i height=%i
+         [source src="%s/video/%s/%s.mp4" type="video/mp4"]
+       ]' "$VIDEO_RESX" "$VIDEO_RESY" "$_BASE" "$channel" "$video"
         )
        $(AUTHOR && printf '[a .button href="edit" edit]')
        [h1 .name $(HTML "$VIDEO_NAME")]
index aca0303760fb05946b7d74017090d3612e131a22..320ec9a62e228fc56931ba55a7802e586b5c7497 100644 (file)
@@ -213,23 +213,28 @@ body.channels main .channel > .description h2 {
   max-height: 8em;
 }
 
-.video.edit form > .delete {
+body.video.edit form > .delete {
   text-align: right;
 }
-.video.edit form #delconfirm + label:after {
+body.video.edit form #delconfirm + label:after {
   content: '\0A';
   white-space: pre;
 }
-.video.edit form #delconfirm + label + button {
+body.video.edit form #delconfirm + label + button {
   pointer-events: none;
   color: #AAA;
   border-color: #AAA;
   left: -.75em;
 }
-.video.edit form #delconfirm:checked + label + button {
+body.video.edit form #delconfirm:checked + label + button {
   pointer-events: auto;
   color: inherit;
   border-color: inherit;
   background-color: #FDD;
 }
 
+body.video video {
+  display: block;
+  margin: 0 auto;
+  max-height: 80vh;
+}