Skip to content

A self-hosted media server and file management system

fix: video heatmap throws exceptions if playback data fails to load

aminnausincfe75fbdb457
diff --git a/resources/js/components/video/VideoHeatmap.vue b/resources/js/components/video/VideoHeatmap.vue
index 76d6d262..f50dd36f 100644
--- a/resources/js/components/video/VideoHeatmap.vue
+++ b/resources/js/components/video/VideoHeatmap.vue
@@ -83,7 +83,7 @@ const heatMap = computed(() => {
catmullRomFitting(
props.playbackData
? [
- ...props.playbackData.map((entry: { progress: any; count: number }) => {
+ ...props.playbackData?.map((entry: { progress: any; count: number }) => {
return { x: entry.progress, y: 100 - Math.min(entry.count, 10) * 10 };
}),
{ x: 1000, y: 100 },
@@ -98,7 +98,7 @@ const heatMap = computed(() => {
<svg
:class="[
getScreenSize() === 'default' ? 'opacity-65' : 'opacity-0 peer-hover:opacity-65',
- 'ytp-heat-map-svg fill-indigo-200/20 w-full h-6 pointer-events-none transition-opacity duration-200',
+ 'ytp-heat-map-svg pointer-events-none h-6 w-full fill-indigo-200/20 transition-opacity duration-200',
]"
preserveAspectRatio="none"
viewBox="0 0 1000 100"