Skip to content

Commit

Permalink
Add fallback thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasReumann committed Aug 10, 2023
1 parent 91fa34b commit c61b086
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Binary file added branding/thumb-fallback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/assets/img/thumb-fallback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions web/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ func getDefaultStaticBrandingFiles() []staticFile {
{Name: "favicon.ico", Path: "assets/favicon.ico"},
{Name: "icons-192.png", Path: "assets/img/icons-192.png"},
{Name: "icons-512.png", Path: "assets/img/icons-512.png"},
{Name: "thumb-fallback.png", Path: "assets/img/thumb-fallback.png"},
}
}

Expand Down
8 changes: 4 additions & 4 deletions web/template/home.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
</span>
</div>
<a :href="`/w/${livestream.Course.Slug}/${livestream.Stream.ID}`">
<div :style="`background-image:url('/api/stream/${livestream.Stream.ID}/thumbs/live')`"
<div :style="`background:url('/api/stream/${livestream.Stream.ID}/thumbs/live'), url('/thumb-fallback.png')`"
class="h-full tum-live-thumbnail"></div>
</a>
</div>
Expand Down Expand Up @@ -437,7 +437,7 @@
<article class="tum-live-stream group sm:col-span-1 col-span-full"
@click.outside="vod.Dropdown.toggle(false)">
<a :href="course.WatchURL(vod.ID)" class="block mb-2">
<div :style="`background-image:url('/api/stream/${vod.ID}/thumbs/vod')`"
<div :style="`background: url('/api/stream/${vod.ID}/thumbs/vod'), url('/thumb-fallback.png')`"
class="aspect-video tum-live-thumbnail">
<div :id="`vod-progress-${vod.ID}`"
class="tum-live-thumbnail-progress">
Expand Down Expand Up @@ -626,7 +626,7 @@
</template>
</div>
<a :href="`/w/${livestream.Course.Slug}/${livestream.Stream.ID}`">
<div :style="`background-image:url('/api/stream/${livestream.Stream.ID}/thumbs/live')`"
<div :style="`background:url('/api/stream/${livestream.Stream.ID}/thumbs/live'), url('/thumb-fallback.png')`"
class="h-full tum-live-thumbnail"></div>
</a>
<div class="tum-live-badge absolute bg-black/[.8] text-white bottom-2 right-2 z-40 text-xs">
Expand Down Expand Up @@ -704,7 +704,7 @@
<template x-for="course in recently.get()" :key="course.ID">
<article class="tum-live-stream sm:col-span-1 col-span-full p-3">
<a :href="course.LastRecordingURL()" class="block mb-2">
<div :style="`background-image:url('/api/stream/${course.LastRecording.ID}/thumbs/vod')`"
<div :style="`background:url('/api/stream/${course.LastRecording.ID}/thumbs/vod'), url('/thumb-fallback.png')`"
class="aspect-video tum-live-thumbnail">
<div :id="`vod-progress-${course.LastRecording.ID}`"
class="tum-live-thumbnail-progress">
Expand Down

0 comments on commit c61b086

Please sign in to comment.