Skip to content

Drag and Drop to create Markdown videos in MDX files #378

Open
@karlhorky

Description

@karlhorky

Initial checklist

Problem

Quickly authoring MDX documents by dragging and dropping videos is a nice DX

There is a drag and drop feature introduced in VS Code 1.70 (thanks @mjbvz) that allowed for handling dropped files (either from the VS Code explorer, editor tabs, the OS, or other applications) (extension sample) - activate this feature by holding shift while dragging a file.

With Markdown files (*.md), VS Code allows for creating a Markdown video:

Inserting.a.video.using.drag.and.drop.mp4

It would be amazing if creating Markdown videos with drag and drop was also supported in an MDX file.

Currently, it inserts the path.

Solution

Apparently in VS Code 1.78 (April 2023) - or maybe earlier - there is an option for extensions to contribute their own options to this list:

VS Code includes a few built-in ways to drop common content formats. Extensions can also add their own drop options using the DocumentDropEditProvider API.

Source: https://code.visualstudio.com/updates/v1_78#_drop-selector

Maybe this would be the way to contribute this action of "Insert Markdown Video"

I would suggest a simple implementation:

  • only handle single video files
  • HTML video element without extra source elements

Related

Drag and drop for images has been implemented in PR #346 and #357, as a response to #322

Alternatives

Installing the Drag And Drop Import Relative Path extension by @ElecTreeFrying

Metadata

Metadata

Assignees

No one assigned

    Labels

    🤞 phase/openPost is being triaged manually

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions