condenser icon indicating copy to clipboard operation
condenser copied to clipboard

Make it simpler to add support for embedded video player

Open quochuy opened this issue 5 years ago • 1 comments

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.

quochuy avatar Dec 10 '19 02:12 quochuy

Already started, just awaiting for results on https://github.com/steemit/condenser/pull/3655 to merge back and refactor into the new format.

quochuy avatar Jan 12 '20 20:01 quochuy