microsoft / microsoft/AdaptiveCards
[JS] Inline YouTube, Vimeo and Dailymotion video playback
Nobody has claimed this yet.
- 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
sourcescollection, theMediaelement is setup to embed an inline player instead of the standard HTML5 media player- The
mimeTypeproperty isn't required for YouTube sources - If a URL pattern is detected in the
sourcesproperty, all other sources are ignored
- The
- The Media element will attempt to pull the poster URL automatically from the various providers IF the
posterproperty sin't specified - As the
playbutton is clicked, theMediaelement 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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