Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link to tweet instead of embedding video tweets in Firefox
Browse files Browse the repository at this point in the history
djmaze committed Mar 15, 2022

Verified

This commit was signed with the committer’s verified signature.
brandonkelly Brandon Kelly
1 parent 0060a72 commit a415a7f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/embed/tweet.js
Original file line number Diff line number Diff line change
@@ -110,14 +110,16 @@ class Tweet extends Observable(Embed) {
m.imageUrl = `${this.url}-images-${idx}`
if (m.type === 'video') {
m.targetUrl = m.expanded_url
m.video = {
imageUrl: m.imageUrl,
videoUrls: m.video_info.variants.map((m, idx) => {
return {
url: m.url,
contentType: m.content_type
}
})
if (navigator.userAgent.indexOf('Firefox') === -1) {
m.video = {
imageUrl: m.imageUrl,
videoUrls: m.video_info.variants.map((m, idx) => {
return {
url: m.url,
contentType: m.content_type
}
})
}
}
} else {
m.targetUrl = m.imageUrl

0 comments on commit a415a7f

Please sign in to comment.