mozilla / popcorn-editor

Fork of Webmaker's Popcorn Editor for local use
96 stars 38 forks source link

White list videos videos from Mediawiki to be loaded into editor #15

Open benrito opened 8 years ago

benrito commented 8 years ago

So that only Wikimedia videos can be loaded into the editor.

Nolski commented 8 years ago

@brion What is the url of the videos that we are going to be importing into the editor from? Is there an ID that we want to be able to key these videos upon?

bvibber commented 8 years ago

There's probably two ways to get a base URL -- either a direct download such as:

https://upload.wikimedia.org/wikipedia/commons/6/68/Monte_Br%C3%A8%2C_aerial_recording.webm

(original file)

or

https://upload.wikimedia.org/wikipedia/commons/transcoded/6/68/Monte_Br%C3%A8%2C_aerial_recording.webm/Monte_Br%C3%A8%2C_aerial_recording.webm.720p.webm

(a transcode)

-OR- one may have the URL of the wiki 'File:' page, which confusingly also ends with '.webm', '.ogv' etc but is actually an HTML page. :) This would be equivalent of using a YouTube link URL:

https://commons.wikimedia.org/wiki/File:Monte_Br%C3%A8,_aerial_recording.webm

I think the most user-friendly would be to encourage the use of the wiki URLs, since it's kinda tricky to get at the raw files (and that locks you in to a particular resolution etc).

Nolski commented 8 years ago

So when building this white-listing functionality for Air Mozilla there were two main changes that needed to happen to the editor. The first was detecting that the url pasted into the editor was of a [specific category]https://github.com/mozilla/popcorn-editor/blob/master/PopcornEditor/src/util/mediatypes.js#L19) and then we had to extract some UUID from that URL and then hit an API endpoint that Air Mozilla had to get all the metadata information for the video (as well as the URL to the video itself) https://github.com/mozilla/popcorn-editor/blob/master/PopcornEditor/src/util/mediatypes.js#L19

bvibber commented 8 years ago

The id will be the portion after "/wiki/" in the wiki page URL; url-decoded. We can pass that to media wiki API to get the metadata.

bvibber commented 8 years ago

With https://github.com/mozilla/popcorn-editor/issues/16 mostly working I think this is closer to being able to whitelist

cache0928 commented 8 years ago

hello,I'm a student, I want to study popcorn and do development on it. But I'm a newcomer to this field, Could you give me some study materials to help me studying more quickly?@brion