Skip to content

editor(plugin-video): allow native html5 video media types #4059

@oellers

Description

@oellers

Current state

  • Supports YouTube, Vimeo and WikimediaCommons media sources

Goal

  • Allow native html5 video media types
    • video/mp4
    • video/webm
    • video/ogg

Draft

Discussion (UX)

  • Currently, media sources from youtube, vimeo and wikimedia commons are validated by regex;
  • There are several challenges with validating arbitrary remote urls

How can remote media types be validated?

  1. Extension validation (soft validation)
    Url indicates a typical media extension type (e.g. .mp4, .webm, .ogg for html5 video elements).
    Disadvantages:

    • No real validation of media type
    • Other URLs serving media would be invalid (if this is the only type of validation);
      workarounds by suffixing with a valid media type, e.g. in the query parameter (bad ux)
  2. Header validation
    Retrieve the content-type response header from the URL.
    A (cors) request to get the headers of the URL could be initiated.
    Disadvantages:

    • A frontend request will only work based on regular CORS restrictions (appropriate Access-Control-Allow-Origin headers), there's a good chance this won't work in most cases.
      • Alternative: Headers could be validated with a backend proxy route, e.g. compared to mathpix proxy, but this would introduce cross-origin dependencies

How do others deal with this situation?

H5P

Conclusion

Follow up question
What are the opinions of the Serlo maintainers on that matter? I could prepare a PR based on the decision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions