From 04575094823770b49042d63d94b28a8233725bf4 Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Mon, 28 Nov 2022 14:54:06 -0600 Subject: [PATCH] Add audio and video embeds to map popups --- resources/views/tracker.blade.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/resources/views/tracker.blade.php b/resources/views/tracker.blade.php index 8c9bdd1..c6c2e6c 100644 --- a/resources/views/tracker.blade.php +++ b/resources/views/tracker.blade.php @@ -88,8 +88,25 @@ icon: markerIcon }).addTo(map); + $popupContent = null; + @if(preg_match("/\[\[([^\]]+)\]\]/", $checkin->note, $filepath)) + @if(preg_match("/\.webm/", $filepath[1])) + @php $popupContent = ``; @endphp + @elseif(preg_match("/\.ogg/", $filepath[1])) + @php $popupContent = ``; @endphp + @endif + @else + @php $popupContent = ``; @endphp + @endif + popupMarkup = ``; - popupMarkup += ``; + popupMarkup += $popupContent; popupMarkup += ''; marker.bindPopup(popupMarkup).openPopup();