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
|
|
@ -296,6 +296,40 @@ button, input, textarea, select {
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.video-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.video-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
cursor: pointer;
|
||||
transition: background 0.15s ease;
|
||||
}
|
||||
|
||||
.video-overlay:hover {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.video-overlay .play-button {
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
color: #fff;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1.5rem;
|
||||
padding-left: 0.25rem;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.embed-container {
|
||||
position: relative;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -378,6 +378,19 @@ async function deleteItem(id) {
|
|||
}
|
||||
}
|
||||
|
||||
// Play video (initial click to start)
|
||||
function playVideo(overlay) {
|
||||
const container = overlay.parentElement;
|
||||
const video = container.querySelector('video');
|
||||
if (video) {
|
||||
video.play();
|
||||
overlay.remove();
|
||||
// Show controls on hover
|
||||
video.addEventListener('mouseenter', () => video.controls = true);
|
||||
video.addEventListener('mouseleave', () => video.controls = false);
|
||||
}
|
||||
}
|
||||
|
||||
// Utility
|
||||
function escapeHtml(str) {
|
||||
const div = document.createElement('div');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue