Add video proxy to fix Firefox tracking protection blocking Twitter videos
Twitter's video.twimg.com CDN is blocked by Firefox's Enhanced Tracking
Protection when loaded cross-origin. This adds a server-side proxy that
streams videos through our domain.
- Add /proxy/video/{id} endpoint to proxy embed video URLs
- Update embed video player: click-to-play with overlay, muted, looping
- Show native controls on hover
This commit is contained in:
parent
2887d9c430
commit
9aa8373055
5 changed files with 130 additions and 2 deletions
|
|
@ -53,9 +53,12 @@ func (c itemPageContent) Render(sw *ssr.Writer) error {
|
|||
{{else if eq .Item.ItemType "embed"}}
|
||||
{{if .Item.EmbedVideoURL}}
|
||||
<div class="video-container">
|
||||
<video controls poster="{{if .Item.ThumbnailID}}/media/{{.Item.ThumbnailID}}{{end}}">
|
||||
<source src="{{.Item.EmbedVideoURL}}" type="video/mp4">
|
||||
<video loop muted playsinline poster="{{if .Item.ThumbnailID}}/media/{{.Item.ThumbnailID}}{{end}}">
|
||||
<source src="/proxy/video/{{.Item.ID}}" type="video/mp4">
|
||||
</video>
|
||||
<div class="video-overlay" onclick="playVideo(this)">
|
||||
<span class="play-button">▶</span>
|
||||
</div>
|
||||
</div>
|
||||
{{else if .Item.ThumbnailID}}
|
||||
<div class="image-container">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue