build: add support for Facebook videos. As Facebook doesn't provide a…#1
build: add support for Facebook videos. As Facebook doesn't provide a…#1liamtarpey wants to merge 1 commit into
Conversation
… video ID in it's embed code, we need to use the path that's supplied in the iframe embed link such as "https%3A%2F%2Fwww.facebook.com%2Ftheguardian%2Fvideos%2F563281880526246%2F&show_text=0&width=400"
tinacious
left a comment
There was a problem hiding this comment.
Thanks for your contribution but please review feedback and make necessary changes. Will review again once changes have been made.
|
|
||
|
|
||
| case 'facebook': | ||
| videoCode = '<iframe src="https://www.facebook.com/plugins/video.php?href=' + videoId + '" width="400" height="400" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allowFullScreen="true"></iframe>'; |
There was a problem hiding this comment.
The existing code style should be respected re: attribute value assignment for the iframe, e.g. allowFullscreen rather than allowFullscreen="true". It is generally best practice to follow the existing file's code style when contributing to an open-source project.
You have also added inline styles—border: none; is a style choice rather than required for the video to render. Why was overflow: hidden added? If neither of these are required for the functioning of Facebook video, please remove, otherwise add some spaces to make the declarations more readable.
Also, please remove the counter-productive width and height attributes—these are overwritten by the JavaScript code, and the whole point of this plugin is to not have hard video dimensions. These are redundant and can be confusing to anyone else reading the code because there is no point in adding attributes that get overridden.
Add support for Facebook videos. As Facebook does not provide the video ID in it's embed code, we need to use the path that's supplied in the iframe embed link such as "https%3A%2F%2Fwww.facebook.com%2Ftheguardian%2Fvideos%2F563281880526246%2F&show_text=0&width=400" as the video-id.