- $( AUTHOR && [ $VIDEO_STATUS = void ] && printf '
- [iframe src="frameuploadprogress" width="100%%" height="50"
- [a href="freameuploadprogress" Iframe: Upload progress]
- ]
- [iframe src="frameupload" width="100%%" height="50"
- [form .upload method=POST enctype="multipart/form-data"
- [input type=file name=upload]
- [submit "action" "video_upload" Upload]
- ]
- ]')
- $( [ $VIDEO_STATUS != void ] && printf '
- [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"
- )
+ [video preload=none controls=controls width="$VIDEO_RESX" height="$VIDEO_RESY"
+ $([ -f "$VIDEO_MP4" ] \
+ && printf '[source src="%s/video/%s/%s.mp4" type="video/mp4"]' \
+ "$_BASE" "$CHANNEL_ID" "$VIDEO_ID"
+ [ -f "$VIDEO_WEBM" ] \
+ && printf '[source src="%s/video/%s/%s.webm" type="video/webm"]' \
+ "$_BASE" "$CHANNEL_ID" "$VIDEO_ID"
+ [ ! -f "$VIDEO_MP4" -a ! -f "$VIDEO_WEBM" ] \
+ && printf '[source src="%s/video/%s/%s.upload.mp4" type="video/mp4"] %s' \
+ "$_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
+ })