Add array index

This commit is contained in:
Ben Goldsworthy 2022-11-28 14:34:57 -06:00
parent 64fc3e9586
commit 767be0043a

View file

@ -7,15 +7,15 @@
</summary>
@if($checkin->note)
@if(preg_match("/\[\[[^\]]+\]\]/", $checkin->note, $filepath))
@if(preg_match("/\.webm/", $filepath))
@if(preg_match("/\.webm/", $filepath[0]))
<video controls>
<source src="/{{ $filepath }}" type="video/webm">
<p>Your browser doesn't support HTML video. Here is a <a href="/{{ $filepath }}">link to the video</a> instead.</p>
<source src="/{{ $filepath[0] }}" type="video/webm">
<p>Your browser doesn't support HTML video. Here is a <a href="/{{ $filepath[0] }}">link to the video</a> instead.</p>
</video>
@elseif(preg_match("/\.ogg/", $filepath))
@elseif(preg_match("/\.ogg/", $filepath[0]))
<audio controls>
<source src="/{{ $filepath }}" type="audio/off">
<p>Download <a href="/{{ $filepath }}">OGG</a> audio.</p>
<source src="/{{ $filepath[0] }}" type="audio/off">
<p>Download <a href="/{{ $filepath[0] }}">OGG</a> audio.</p>
</audio>
@endif
@else