mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-14 03:15:49 +02:00
Fix a rare issue where GIFs open in browser due to a missing source URL
This commit is contained in:
parent
c1bc956d6d
commit
9cc1a11bef
@ -936,6 +936,10 @@
|
||||
$TD.playVideo(url, username || null);
|
||||
};
|
||||
|
||||
var getGifLink = function(ele){
|
||||
return ele.attr("src") || ele.children("source[video-src]").first().attr("video-src");
|
||||
};
|
||||
|
||||
var getVideoTweetLink = function(obj){
|
||||
let parent = obj.closest(".js-tweet").first();
|
||||
let link = (parent.hasClass("tweet-detail") ? parent.find("a[rel='url']") : parent.find("time").first().children("a")).first();
|
||||
@ -948,7 +952,7 @@
|
||||
|
||||
app.delegate(".js-gif-play", {
|
||||
click: function(e){
|
||||
let src = !e.ctrlKey && $(this).closest(".js-media-gif-container").find("video").attr("src");
|
||||
let src = !e.ctrlKey && getGifLink($(this).closest(".js-media-gif-container").find("video"));
|
||||
|
||||
if (src){
|
||||
window.TDGF_playVideo(src, getUsername(highlightedTweetObj));
|
||||
|
Loading…
Reference in New Issue
Block a user