Added streaming test

This commit is contained in:
Eduard Urbach 2018-12-08 20:05:17 +09:00
parent 062503d937
commit 85f140fb18
3 changed files with 51 additions and 38 deletions

View File

@ -16,18 +16,7 @@ component AMVVideo(amv *arn.AMV)
//- button.media-play-button //- button.media-play-button
//- RawIcon("play") //- RawIcon("play")
.video-controls VideoControls(amv.ID, amv.Info.Duration)
.video-progress-clickable
.video-progress-container
.video-progress
.video-time= fmt.Sprintf("%d:%02d", int(amv.Info.Duration.Minutes()), int(amv.Info.Duration.Seconds()) % 60)
//- button.video-control.action(data-action="like", data-trigger="click")
//- RawIcon("heart-o")
button.video-control.action(data-action="toggleFullscreen", data-trigger="click", data-id=amv.ID, aria-label="Fullscreen")
RawIcon("fullscreen")
component AMVFooter(amv *arn.AMV, user *arn.User) component AMVFooter(amv *arn.AMV, user *arn.User)
.amv-footer .amv-footer

13
mixins/VideoControls.pixy Normal file
View File

@ -0,0 +1,13 @@
component VideoControls(containerId string, duration time.Duration)
.video-controls
.video-progress-clickable
.video-progress-container
.video-progress
.video-time= fmt.Sprintf("%d:%02d", int(duration.Minutes()), int(duration.Seconds()) % 60)
//- button.video-control.action(data-action="like", data-trigger="click")
//- RawIcon("heart-o")
button.video-control.action(data-action="toggleFullscreen", data-trigger="click", data-id=containerId, aria-label="Fullscreen")
RawIcon("fullscreen")

View File

@ -2,19 +2,29 @@ component AnimeEpisode(anime *arn.Anime, episode *arn.AnimeEpisode, episodeIndex
h1 h1
a(href=anime.Link())= anime.Title.ByUser(user) a(href=anime.Link())= anime.Title.ByUser(user)
.episode-view-image-container if anime.ID == "VhRKhKimR" && episode.Number == 10
if episodeIndex > 0 .widget-form.amv-page
.episode-arrow.episode-arrow-previous .video-container(id="stream-test")
a.light-button(href=anime.Link() + "/episode/" + strconv.Itoa(anime.Episodes().Items[episodeIndex - 1].Number), title="Previous episode") video.video.lazy.action(data-action="playVideo", data-trigger="click", data-media-id="stream-test")
RawIcon("chevron-left") source(data-src="https://arn.sfo2.cdn.digitaloceanspaces.com/videos/anime/VhRKhKimR/10.webm", data-type="video/webm")
a(href=anime.Link(), title=anime.Title.ByUser(user)) VideoControls("stream-test", time.Duration(0))
img.anime-cover-image.lazy(data-src=anime.ImageLink("large"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user))
if episodeIndex < len(anime.Episodes().Items) - 1 br
.episode-arrow.episode-arrow-next else
a.light-button(href=anime.Link() + "/episode/" + strconv.Itoa(anime.Episodes().Items[episodeIndex + 1].Number), title="Next episode") .episode-view-image-container
RawIcon("chevron-right") if episodeIndex > 0
.episode-arrow.episode-arrow-previous
a.light-button(href=anime.Link() + "/episode/" + strconv.Itoa(anime.Episodes().Items[episodeIndex - 1].Number), title="Previous episode")
RawIcon("chevron-left")
a(href=anime.Link(), title=anime.Title.ByUser(user))
img.anime-cover-image.lazy(data-src=anime.ImageLink("large"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user))
if episodeIndex < len(anime.Episodes().Items) - 1
.episode-arrow.episode-arrow-next
a.light-button(href=anime.Link() + "/episode/" + strconv.Itoa(anime.Episodes().Items[episodeIndex + 1].Number), title="Next episode")
RawIcon("chevron-right")
h3.episode-view-number= "Episode " + strconv.Itoa(episode.Number) h3.episode-view-number= "Episode " + strconv.Itoa(episode.Number)
@ -26,17 +36,18 @@ component AnimeEpisode(anime *arn.Anime, episode *arn.AnimeEpisode, episodeIndex
p.episode-view-airing-date p.episode-view-airing-date
span.utc-airing-date(data-start-date=episode.AiringDate.Start, data-end-date=episode.AiringDate.End, data-episode-number=episode.Number)= episode.AiringDate.StartDateHuman() span.utc-airing-date(data-start-date=episode.AiringDate.Start, data-end-date=episode.AiringDate.End, data-episode-number=episode.Number)= episode.AiringDate.StartDateHuman()
if user != nil && user.Location.CountryName != "Japan" if anime.ID != "VhRKhKimR" || episode.Number != 10
.buttons if user != nil && user.Location.CountryName != "Japan"
for serviceName, link := range episode.Links .buttons
a.button(href=link, title="Watch episode " + strconv.Itoa(episode.Number), target="_blank", rel="noopener") for serviceName, link := range episode.Links
Icon("eye") a.button(href=link, title="Watch episode " + strconv.Itoa(episode.Number), target="_blank", rel="noopener")
span= serviceName Icon("eye")
span= serviceName
//- a.button(href=arn.Nyaa.GetLink(anime, fmt.Sprintf("%02d", episode.Number)), title="Download episode " + strconv.Itoa(episode.Number), target="_blank", rel="noopener") //- a.button(href=arn.Nyaa.GetLink(anime, fmt.Sprintf("%02d", episode.Number)), title="Download episode " + strconv.Itoa(episode.Number), target="_blank", rel="noopener")
//- Icon("download") //- Icon("download")
//- span nyaa.si //- span nyaa.si
.footer .footer
p Make sure to support the anime you're watching by buying officially released Blu-rays and merchandise. p Make sure to support the anime you're watching by buying officially released Blu-rays and merchandise.
p Anime Notifier provides links to external websites for convenience reasons. By clicking on these links you are leaving our site. Thus we can not, under no circumstances, be held responsible for the content on external websites. p Anime Notifier provides links to external websites for convenience reasons. By clicking on these links you are leaving our site. Thus we can not, under no circumstances, be held responsible for the content on external websites.