I’m developing a gallery plugin and I was wondering if I could add a YouTube and Vimeo “embed” option to the media uploader to be able to add YouTube and Vimeo videos as attachments to a post instead of uploading the video files directly to the server. I’m thinking along the lines of an option with a textarea where one could put the YouTube or Vimeo HTML embed code and this would be added to the media library with a mime type of “text/html”.
Any clues would be much appreciated
Attachment represents a file on your server that you may include its url in your content. All attachments are supposed to be in the media library. It is easy to see that by this definition your idea doesn’t fit the wordpress attachment model (images that are off server are not attachments).
Your idea has merit but since it doesn’t fit the wordpress model right now (version 3.7) I am not sure how easy it will be to implement it.
The OEmbed in Library plugin shows that it can be done. It just lacks a link on the media uploader.