mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Add embed link to watch page
This commit is contained in:
parent
68552b6d65
commit
30c92ce1b7
2 changed files with 11 additions and 0 deletions
|
@ -28,6 +28,14 @@ class Invidious::Routes::Watch < Invidious::Routes::BaseRoute
|
|||
return env.redirect "/"
|
||||
end
|
||||
|
||||
embed_link = "/embed/#{id}"
|
||||
if env.params.query.size > 1
|
||||
embed_params = env.params.query.dup
|
||||
embed_params.delete_all("v")
|
||||
embed_link += "?"
|
||||
embed_link += embed_params.to_s
|
||||
end
|
||||
|
||||
plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
|
||||
continuation = process_continuation(PG_DB, env.params.query, plid, id)
|
||||
|
||||
|
|
|
@ -89,6 +89,9 @@
|
|||
<span id="watch-on-youtube">
|
||||
<a href="https://www.youtube.com/watch?v=<%= video.id %>"><%= translate(locale, "Watch on YouTube") %></a>
|
||||
</span>
|
||||
<p id="embed-link">
|
||||
<a href="<%= embed_link %>"><%= translate(locale, "Embed Link") %></a>
|
||||
</p>
|
||||
<p id="annotations">
|
||||
<% if params.annotations %>
|
||||
<a href="/watch?<%= env.params.query %>&iv_load_policy=3">
|
||||
|
|
Loading…
Reference in a new issue