<% cache @clip do %>

<%= @clip.title %>

<% end %> <% if @clip.video.attached? %> <% end %>
<%= video_tag @clip.video, :controls => true%> <% if authenticated? %> <% end %>
Clip ID: <%= @clip.id %>
Category: <%= link_to @clip.category.name, @clip.category %>
Tags: <% @clip.tags.each_with_index do |tag, index| %> <%= link_to tag.name, tag_path(tag) %><% if index < @clip.tags.size - 1 %>, <% end %> <% end %>
Length: <%= seconds_to_time(@clip.video.metadata["duration"]) %>
Resolution: <%= @clip.video.metadata["width"].round %>x<%= @clip.video.metadata["height"].round %> (<%= get_video_aspect(@clip.video) %>)
Last Updated: <%= @clip.updated_at %>
Created: <%= @clip.created_at %>
<%= button_to "Edit", edit_clip_path(@clip), :method => "get" %> <%= button_to "Delete", @clip, method: :delete, data: { turbo_confirm: "Are you sure?" } %>