condenser
condenser copied to clipboard
Make it simpler to add support for embedded video player
This is a note for refactoring the embedded player logic in the Condenser. Currently, we need to modify multiple files in order to support other video platform (youtube, dtube etc...). This can be changed to read a config file (JSON). For example:
{
"vimeo": {
"regex": {
"link": "/https?:\/\/(?:vimeo.com\/|player.vimeo.com\/video\/)([0-9]+)\/?(#t=((\d+)s?))?\/?/",
"videoId": "/(?:vimeo.com\/|player.vimeo.com\/video\/)([0-9]+)/"
},
"code": {
"thumbnail": "https://img.youtube.com/vi/<VIDEO_ID>/0.jpg",
"embeddedPlayer": "https://www.youtube.com/embed/<VIDEO_ID>",
}
}
}
This will make it easier to add support for more platforms in the future.
Already started, just awaiting for results on https://github.com/steemit/condenser/pull/3655 to merge back and refactor into the new format.