microsoft / microsoft/AdaptiveCards

[JS] Inline YouTube, Vimeo and Dailymotion video playback

Open
#7,111 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Request
Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

This proposal is implemented here: https://github.com/microsoft/AdaptiveCards/pull/7112

Problem Statement

Currently, it is not possible to embed a YouTube, Dailymotion, Vimeo (and quite a few other for that matter) video in an Adaptive Card. This feature would make that possible.

Proposed solution

We extend the existing Media element with no schema change. The updated logic does the following:

  • If a URL matching a a YouTube, Vimeo or Dailymotion pattern is found in the sources collection, the Media element is setup to embed an inline player instead of the standard HTML5 media player
    • The mimeType property isn't required for YouTube sources
    • If a URL pattern is detected in the sources property, all other sources are ignored
  • The Media element will attempt to pull the poster URL automatically from the various providers IF the poster property sin't specified
  • As the play button is clicked, the Media element instantiates the embedded player and automatically starts playback
Alternatives or Workarounds

The only alternative currently is to use an image that represents a video thumbnail and to include an OpenURL action somewhere in the card to open the video on the appropriate web site.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked pull request 7112 and the existing Media element implementation. Confirm whether the proposed YouTube, Vimeo, and Dailymotion behavior is already covered, including poster handling and playback, and verify the relevant JavaScript tests if present.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.