2020-08-30 13:54:59 +00:00
|
|
|
extends includes/layout
|
2020-08-22 13:17:31 +00:00
|
|
|
|
2020-08-30 13:54:59 +00:00
|
|
|
include includes/video-list-item
|
|
|
|
include includes/subscribe-button
|
2020-08-24 10:43:55 +00:00
|
|
|
|
2020-08-22 13:17:31 +00:00
|
|
|
block head
|
2020-08-31 13:22:16 +00:00
|
|
|
unless error
|
|
|
|
title= `${video.title} - CloudTube`
|
|
|
|
else
|
|
|
|
title Error - CloudTube
|
2020-08-22 13:17:31 +00:00
|
|
|
script(type="module" src=getStaticURL("html", "/static/js/player.js"))
|
|
|
|
script const data = !{JSON.stringify(video)}
|
|
|
|
|
|
|
|
block content
|
2020-08-31 13:22:16 +00:00
|
|
|
unless error
|
|
|
|
main.video-page
|
|
|
|
- const sortedFormatStreams = video.formatStreams.slice().sort((a, b) => b.second__height - a.second__height)
|
2020-08-31 13:36:55 +00:00
|
|
|
- const sortedVideoAdaptiveFormats = video.adaptiveFormats.filter(f => f.type.startsWith("video") && f.qualityLabel).sort((a, b) => a.second__order - b.second__order)
|
2020-08-31 13:22:16 +00:00
|
|
|
|
|
|
|
.main-video-section
|
|
|
|
.video-container
|
|
|
|
- const format = sortedFormatStreams[0]
|
2020-09-24 03:55:13 +00:00
|
|
|
if format
|
|
|
|
video(controls preload="auto" width=format.second__width height=format.second__height data-itag=format.itag)#video.video
|
|
|
|
source(src=format.url type=format.type)
|
|
|
|
else
|
|
|
|
video(src="")#video.video
|
|
|
|
.stream-notice The server provided no playback streams.
|
2020-08-31 13:22:16 +00:00
|
|
|
|
|
|
|
#current-time-container
|
|
|
|
#end-cards-container
|
|
|
|
.info
|
|
|
|
header.info-main
|
|
|
|
h1.title= video.title
|
|
|
|
.author
|
|
|
|
a(href=`/channel/${video.authorId}`).author-link= `Uploaded by ${video.author}`
|
|
|
|
.info-secondary
|
|
|
|
- const date = new Date(video.published*1000)
|
|
|
|
- const month = new Intl.DateTimeFormat("en-US", {month: "short"}).format(date.getTime())
|
|
|
|
div= `Uploaded ${date.getUTCDate()} ${month} ${date.getUTCFullYear()}`
|
|
|
|
div= video.second__viewCountText
|
|
|
|
div(style=`--rating: ${video.rating*20}%`)#rating-bar.rating-bar
|
|
|
|
|
|
|
|
audio(preload="auto")#audio
|
|
|
|
#live-event-notice
|
|
|
|
#audio-loading-display
|
|
|
|
|
|
|
|
.button-container
|
|
|
|
+subscribe_button(video.authorId, subscribed, `/watch?v=${video.videoId}`).border-look
|
|
|
|
//- button.border-look#theatre Theatre
|
|
|
|
select(autocomplete="off").border-look#quality-select
|
|
|
|
each f in sortedFormatStreams
|
|
|
|
option(value=f.itag)= `${f.qualityLabel} ${f.container}`
|
|
|
|
each f in sortedVideoAdaptiveFormats
|
|
|
|
option(value=f.itag)= `${f.qualityLabel} ${f.container} *`
|
|
|
|
//-
|
|
|
|
a(href="/subscriptions").border-look
|
|
|
|
img(src="/static/images/search.svg" width=17 height=17 alt="").button-icon
|
|
|
|
| Search
|
|
|
|
//- button.border-look#share Share
|
2020-09-15 11:30:47 +00:00
|
|
|
a(href=`https://www.youtube.com/watch?v=${video.videoId}#cloudtube`).border-look YouTube
|
2020-08-31 13:22:16 +00:00
|
|
|
a(href=`https://invidio.us/watch?v=${video.videoId}`).border-look Invidious
|
|
|
|
|
|
|
|
.description!= video.descriptionHtml
|
|
|
|
|
|
|
|
aside.related-videos
|
|
|
|
h2.related-header Related videos
|
|
|
|
each r in video.recommendedVideos
|
2020-12-28 12:42:25 +00:00
|
|
|
+video_list_item("related-video", r, instanceOrigin)
|
2020-08-31 13:22:16 +00:00
|
|
|
|
|
|
|
else
|
|
|
|
//- error
|
|
|
|
main.video-error-page
|
|
|
|
h2 Error
|
|
|
|
!= message
|
2020-09-23 11:45:02 +00:00
|
|
|
p: a(href=`https://www.youtube.com/watch?v=${video.videoId}#cloudtube`) Watch on YouTube →
|