Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export function convertToEmbedUrl(url: string): string | null {
return id ? `https://player.vimeo.com/video/${id}` : null
}

// --- ODL VIDEO EMBED ---
if (hostname === "video.odl.mit.edu") {
Copy link
Copy Markdown
Contributor Author

@ChristopherChudzicki ChristopherChudzicki Feb 26, 2026

Choose a reason for hiding this comment

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

Might change / better organization this validation. See https://github.com/mitodl/mit-learn/pull/2968/changes#r2860467411 for discussion.

is an effort to support video embeddings directly in the article editor without iframes. We need this soon, though, and we need it with transcripts and cover images, so we are going to use the OVS video embed page for now.

Copy link
Copy Markdown
Contributor Author

@ChristopherChudzicki ChristopherChudzicki Feb 26, 2026

Choose a reason for hiding this comment

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

I guess I should mention that the thumbnail and captions aren't actually working at https://video.odl.mit.edu/videos/5444a783abb94d1fb773ff390d21a603/embed/ (The data exists, but isn't hooked up to videojs quite right), but Matt is working on fixing that and it seems like a much smaller lift than adding m3u8+Captions+cover images here.

return url
Comment on lines +48 to +49
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The convertToEmbedUrl function returns video.odl.mit.edu URLs as-is, but they require transformation to an embed format (e.g., adding /embed/) to work in an iframe.
Severity: HIGH

Suggested Fix

Modify the convertToEmbedUrl function to handle video.odl.mit.edu URLs. The logic should extract the video ID from the path and construct a new URL in the correct embed format, https://video.odl.mit.edu/videos/{VIDEO_ID}/embed/, similar to how YouTube and Vimeo URLs are transformed.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location:
frontends/main/src/page-components/TiptapEditor/extensions/node/MediaEmbed/lib.ts#L48-L49

Potential issue: The `convertToEmbedUrl` function identifies URLs from
`video.odl.mit.edu` but returns them without modification. For these videos to be
embeddable in an iframe, the URL must be transformed into the format
`https://video.odl.mit.edu/videos/{VIDEO_ID}/embed/`. The current implementation will
pass the original, non-embeddable URL directly to the iframe's `src` attribute. This
will result in a broken or blank video embed for any user attempting to embed a video
from this service using a standard video page URL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

People will paste the embed video, we may end up allowing m3u8 directly also subsequently, so let's leave this as is

}

// Not a supported video platform
return null
}
Loading