Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add <track> to <video> if there's a .vtt file #289

Open
jonatron opened this issue Feb 3, 2025 · 18 comments
Open

Add <track> to <video> if there's a .vtt file #289

jonatron opened this issue Feb 3, 2025 · 18 comments

Comments

@jonatron
Copy link
Contributor

jonatron commented Feb 3, 2025

We now have .vtt files, from SReview and Whisper, so we can now add captions.

@jonatron
Copy link
Contributor Author

jonatron commented Feb 3, 2025

I have to guess because I don't have the pretalx db, only the sample. It'd be something like this: https://github.com/jonatron/website/compare/master...jonatron:website:video_track_captions?expand=1

@johanvdw
Copy link
Member

johanvdw commented Feb 4, 2025

Thanks for your contribution!

I'll do a check with the actual data from pretalx.

@jonatron
Copy link
Contributor Author

jonatron commented Feb 4, 2025

Just checked adding a track in devtools, I get:
Security Error: Content at https://fosdem.org/2025/schedule/event/fosdem-2025-5370-using-dpop-to-use-access-tokens-securely-in-your-single-page-applications/ may not load data from https://video.fosdem.org/2025/aw1120/fosdem-2025-4526-discovering-indoor-environments-and-positioning-systems.vtt .
So it needs a CORS or CSP header change too.

@johanvdw
Copy link
Member

johanvdw commented Feb 5, 2025

You should probably only add vtt if it exists.

@jonatron
Copy link
Contributor Author

jonatron commented Feb 9, 2025

I updated the above branch to only add a track if a vtt exists. I also added crossorigin="anonymous", but it'll need Access-Control-Allow-Origin: https://fosdem.org added to video.fosdem.org .vtt file response headers, hopefully someone can sort that out?

@jonatron
Copy link
Contributor Author

@gerryd do you know if it's possible to add that CORS header?

@johanvdw
Copy link
Member

Can you make a PR? I was looking for this for a while but didn't find it because it was an issue and not a PR.
We can add the header to video.fosdem.org

@johanvdw
Copy link
Member

I actually started doubting my own statement: because we use mirrors, we may not control the cors stuff. But anyway, we can try.

@jonatron
Copy link
Contributor Author

It might be OK, it looks like currently video files send a location header to a mirror, but the vtt file is served direct.

@johanvdw
Copy link
Member

#279 (comment) for a larger export file if you want to test on a larger scale.

@jonatron
Copy link
Contributor Author

Seems to work with that export, thanks.

@jonatron
Copy link
Contributor Author

It looks like crossorigin="anonymous" made the CORS header required on the video file. I thought it'd only affect the track. Assuming you can't add the header to videos because there's mirrors, I think the only way to make it work would to have the .vtt file on the fosdem.org domain, and remove crossorigin="anonymous" .

@johanvdw
Copy link
Member

Yes, I reverted your patch as you saw.

I don't really understand why the CORS would block vtt and not the videos themselves.
What would happen if we just remove the crossorigin part?

I can push to our staging environment if we want to test that.

@jonatron
Copy link
Contributor Author

It's annoying but without crossorigin=anonymous, the track .vtt is blocked but the video isn't, checked using devtools:

Image

To proxy the .vtt so it's on the same domain, the nginx conf could look something like:

    location ~* ^/vtt/(.+\.vtt)$ {
        proxy_pass https://video.fosdem.org/$1;
        resolver 8.8.8.8;
    }

Not sure if it's worth it or not, it's only a nice to have, and google chrome has live captions built in to the browser.

@johanvdw
Copy link
Member

johanvdw commented Feb 13, 2025 via email

@jonatron
Copy link
Contributor Author

Oh yeah, that'd work. I didn't realise attachments are on the fosdem.org domain.

@jonatron
Copy link
Contributor Author

jonatron commented Feb 17, 2025

Just having a look attachments and the interaction between sreview and pretalx and website. Attachments are a Resource on a Submission in pretalx. There's an api to add video links https://github.com/FOSDEM/pretalx-integration/blob/v2024.3.1-fosdem/devroom-settings/devroom_settings/views.py#L270 used by https://github.com/FOSDEM/infrastructure/blob/master/ansible/playbooks/roles/encoder-master/files/syncvideos-pretalx . So I guess we'd need another API similar to the one above but to add attachments/resources instead of links to talks/submissions?

@johanvdw
Copy link
Member

what, you found the script used for syncing the videos of last year! (I rewrote it, because I didn't)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants