Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 26, 2025

Implements oEmbed endpoint to expose TuneBridge lookup cards as embeddable content following the oEmbed specification.

Changes

  • New /oembed endpoint (OEmbedController.cs)

    • Returns type: rich responses with iframe embed HTML
    • Supports standard query params: url, format, maxwidth, maxheight
    • Parses card IDs from both /card/{id} and /card/{id}/embed URL patterns
    • Returns 501 for XML format (optional per spec)
  • oEmbed discovery link in Card.cshtml

    • Adds <link rel="alternate" type="application/json+oembed"> for auto-discovery
  • OEmbedResponse DTO with proper JSON property naming per spec

Example

Card pages now include discovery:

<link rel="alternate" type="application/json+oembed" 
      href="https://tunebridge.media/oembed?url=https%3A%2F%2Ftunebridge.media%2Fcard%2Fabc123&format=json" />

Consumers call:

GET /oembed?url=https://tunebridge.media/card/abc123

Response:

{
  "type": "rich",
  "version": "1.0",
  "title": "Track Name",
  "author_name": "Artist",
  "provider_name": "TuneBridge",
  "html": "<iframe src=\".../card/abc123/embed\" ...></iframe>",
  "width": 400,
  "height": 300
}

13 unit tests added covering validation, error cases, and response generation.

Original prompt

This section details on the original issue you should resolve

<issue_title>Support oEmbed with Lookup Result Card as Rich HTML</issue_title>
<issue_description>Summary
Add support for oEmbed in TuneBridge to expose lookup result information as embedded cards using the rich HTML option. Consider utilizing the existing embed functionality to streamline the integration.

Details

  • Implement an oEmbed endpoint that returns the lookup result formatted cards when requested.
  • Use the type: rich HTML oEmbed response to provide a visually attractive, interactive embed for consumers.
  • Leverage or extend current embed code to power the HTML response for oEmbed.

Benefits

  • Makes TuneBridge lookup results easily shareable and embeddable across other platforms, blogs, or documentation.
  • Follows a common integration pattern for modern content and result sharing workflows.

References


If more details (design or API strategy) are needed, provide context in comments or as a follow-up task.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add oEmbed support for lookup result cards in rich HTML Add oEmbed support with rich HTML response for lookup result cards Nov 26, 2025
Copilot AI requested a review from tsmarvin November 26, 2025 08:20
Copilot finished work on behalf of tsmarvin November 26, 2025 08:20
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

Successfully merging this pull request may close these issues.

2 participants