Skip to content

Commit

Permalink
only prefetch video stuffs to avoid competing with other resources
Browse files Browse the repository at this point in the history
  • Loading branch information
breunigs committed Dec 28, 2023
1 parent ae2a0e6 commit 67fcc30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/video/components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ defmodule Video.Components do
}

~H"""
<link rel="preload" as="fetch" crossorigin="anonymous" fetchpriority="low" href={@first_url} :if={@first_url}>
<link rel="preload" as="fetch" crossorigin="anonymous" fetchpriority="low" href={@main_url} id="hlsJsUrl">
<link rel="prefetch" as="fetch" crossorigin="anonymous" fetchpriority="low" href={@first_url} :if={@first_url}>
<link rel="prefetch" as="fetch" crossorigin="anonymous" fetchpriority="low" href={@main_url} id="hlsJsUrl">
<source src={"#{@main_url}#t=#{@start}"} type="application/x-mpegURL">
<%= for {url, codec} <- @variants do %>
<source src={"#{String.replace_suffix(url, ".m3u8", ".m4s")}#t=#{@start}"} type={"video/mp4; codecs=#{codec}"}>
Expand Down

0 comments on commit 67fcc30

Please sign in to comment.