Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/support twitter videos #85

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

djmaze
Copy link

@djmaze djmaze commented Nov 8, 2019

Summary

This PR changes the handling of twitter posts with embedded videos. Instead of linking to a still image of the video, a HTML video element (with preload="none" for data privacy) is embedded into the post.

(refs heiseonline/embetty-server#33)

Update: Firefox' "Tracking Protection" blocks the inline video. As a workaround, videos are now linked to instead of embedded in Firefox.

Motivation

The current twitter video handling is broken (see above).

Review

Embed a twitter post which includes a video.

@StevenKowalzik
Copy link
Member

StevenKowalzik commented Nov 19, 2019

Hi,

thanks for the PR! However, i'm not seeing a video-preview while my browser window exceeds 600px, removing:

@media (min-width: 600px)
<style>
:host #media {
    display: grid;
    grid-column-gap: 1px;
    grid-row-gap: 1px;
}

makes it work on the example site. Could you fix this issues and maybe implement a test that tests your implementation?

@djmaze
Copy link
Author

djmaze commented Nov 19, 2019

@StevenKowalzik The twitter tests are all failing locally for me, and AFAICS they fail for all other open PRs here as well. Maybe there is a general problem? I have almost no experience with javascript testing tools, so maybe someone else could have a look at that first?

@compeak
Copy link
Collaborator

compeak commented Nov 20, 2019

@djmaze You need Twitter credentials to run the tests: https://github.com/heiseonline/embetty-server#configuration

Travis CI does not set secrets for builds triggered by pull requests to prevent exfiltration. This makes the Twitter tests fail for pull requests and succeed after they have been merged.

@StevenKowalzik
Copy link
Member

StevenKowalzik commented Nov 20, 2019

@djmaze I thought about your proposed changes. The preload attribute for the video element is just a hint for the browser, it does not force the browser to act that way. A solution similar to the way embetty implements videos may be a better way in my opinion (create dummy playbutton/onclick event)

@djmaze djmaze force-pushed the support-twitter-videos branch 2 times, most recently from a415a7f to 78587a9 Compare March 15, 2022 17:39
@djmaze djmaze changed the base branch from develop to master March 15, 2022 17:41
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.

3 participants