Skip to content

Conversation

@liamtarpey
Copy link

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.

… 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"
Copy link
Owner

@tinacious tinacious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants