Skip to content

Commit

Permalink
Link to tweet instead of embedding video tweets in Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
djmaze committed Mar 15, 2022
1 parent 810268f commit 78587a9
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
Expand Up @@ -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
Expand Down

0 comments on commit 78587a9

Please sign in to comment.