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

Fix html5 playback #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions wwwroot/src/markup/embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ function embed_html5_video($input, $options = array())
}

$attributes = implode(' ', $attributes);
if(preg_match("/^https?/", $input))
return "<video $attributes><source src='{$input}'></video>";
Comment on lines +53 to +54
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this solution as it could result in video files being embedded from remote hosts. I think if a URL is detected you should use parse_url to extract the path

Copy link

@mozai mozai Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Video files from remote hosts" is a feature not a bug; we want to use CDNs to host the video files, not just serve the video files from the sync instance ie. clients start their session with theatre.wetfish.net, but video files are served from a geolocated loadbalancing cache cdn.wetfish.net .
But there should be a better way than writing an if-exception-then. (new URL($input, $session_baseurl)).href ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mozai this is for the wiki. This has nothing to do with the sync project

return "<video $attributes><source src='/{$input}'></video>";
}

Expand Down