1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Metadata.PlayerView do
7 import Phoenix.HTML.Tag, only: [content_tag: 3, tag: 2]
9 def render("player.html", %{"mediaType" => type, "href" => href}) do
10 {tag_type, tag_attrs} =
12 "audio" <> _ -> {:audio, []}
13 "video" <> _ -> {:video, [loop: true]}
19 tag(:source, src: href, type: type),
20 "Your browser does not support #{type} playback."
22 [controls: true] ++ tag_attrs