]> git.plutz.net Git - rawnet/blobdiff - page_video.sh
For progress frame use chunked encoding instead of long poll
[rawnet] / page_video.sh
index 7fda30ff267a0c463071b85fc6b6c7f49223af3f..3215bbb30d7a57237868eea8b617df14ab52774b 100755 (executable)
@@ -86,7 +86,6 @@ if [ "$CHANNEL_ID" -a "$VIDEO_ID" -a "$action" = edit ]; then
 
 elif [ "$CHANNEL_ID" -a "$VIDEO_ID" -a "$action" = frameuploadprogress ]; then
   AUTHOR || REDIRECT "$_BASE/$CHANNEL_ID/$VIDEO_ID/#ERROR_EDIT_NOTALLOWED"
-  printf '%s\r\n' 'Content-Type: text/html' 'Connection: close' ''
   frame_uploadprogress
 
 elif [ "$CHANNEL_ID" -a "$VIDEO_ID" -a ! -f "$VIDEO_FILE" ] && AUTHOR; then
@@ -121,6 +120,24 @@ elif [ "$CHANNEL_ID" -a "$VIDEO_ID" -a -f "$VIDEO_FILE" ]; then
                    "$_BASE" "$CHANNEL_ID" "$VIDEO_ID" \
                     "The video has not yet been transcoded and may not be displayed correctly."
         )]
+       $([ ! -f "$VIDEO_MP4" -a ! -f "$VIDEO_WEBM" ] && {
+         read file <"$_DATA/transcoding.queue" 
+         if [ "$file" = "$VIDEO_FILE" ]; then
+           printf '[div .transcoding . This video is currently being
+                   converted to various publishing formats. It may not be
+                   rendered correctly until the conversion is finished.]'
+         elif grep -qFx "$VIDEO_FILE" "${_DATA}/transcoding.queue"; then
+           printf '[div .transcoding . This video is not yet converted to a
+                   suitable publishing format. It may not be rendered
+                   correctly until the conversion is finished. The conversion
+                   will start automatically once previous jobs have been
+                   finished.]'
+         else
+           printf '[div .transcoding Publishing formats do not seem to be
+                   available for this video. It may be possible that the
+                   uploaded file is broken and cannot be transcoded.]'
+         fi
+       })
        $(AUTHOR && printf '[a .button href="edit" edit]')
        [h1 .name $(HTML "$VIDEO_NAME")]
        [div .description . ${VIDEO_DESCR_CACHE}]