quad-j/views/file.ejs
2020-10-02 21:59:08 +03:00

44 lines
No EOL
1.9 KiB
Text

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><%= filename %></title>
<% if (fileType !== 'file') { %>
<% if (fileType === 'video') { %>
<meta name="twitter:card" content="player" />
<meta name="twitter:site" content="@harry" />
<meta name="twitter:title" content="<%= filename %>" />
<meta name="twitter:description" content="Video uploaded to hippoz.xyz" />
<meta name="twitter:player" content="<%= fileUrl %>" />
<meta name="twitter:player:width" content="320" />
<meta name="twitter:player:height" content="180" />
<meta name="twitter:player:stream" content="<%= fileUrl %>" />
<meta name="twitter:player:stream:content_type" content="<%= mimeType %>" />
<% } %>
<% if (fileType === 'image') { %>
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@harry" />
<meta name="twitter:title" content="<%= filename %>" />
<meta name="twitter:description" content="Image uploaded to hippoz.xyz" />
<meta name="twitter:image" content="<%= fileUrl %>" />
<% } %>
<meta property="og:<%= fileType %>:url" content="<%= fileUrl %>" />
<meta property="og:<%= fileType %>:secure_url" content="<%= fileUrl %>" />
<meta property="og:<%= fileType %>:type" content="<%= mimeType %>" />
<% } %>
</head>
<body>
<% if (fileType === 'audio' || fileType === 'video') { %>
<<%= fileType %> controls name="media" />
<source src="<%= fileUrl %>" type="<%= mimeType %>">
</<%= fileType %>>
<% } %>
<% if (fileType === 'image') { %>
<img src="<%= fileUrl %>" name="media"></img>
<% } %>
</body>
</html>