Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
nleush committed Jul 31, 2024
2 parents 26c6579 + 51fcb3f commit c220d7f
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugins/domains/facebook.com/facebook.video.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default {
"https://www.facebook.com/sugarandsoulco/videos/1484037581637646/?pnref=story",
"https://www.facebook.com/watch/?v=235613163792499",
"https://www.facebook.com/ScottishDailyExpress/videos/former-scottish-conservative-leader-ruth-davidson-opens-up-about-ivf-struggle-wi/1281761502607093/",
"https://www.facebook.com/reel/805139411583688",
{noFeeds: true}, {skipMixins: ["fb-error"]}
]
};
2 changes: 1 addition & 1 deletion plugins/domains/instagram.com/instagram.com.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default {
// No media - let's validate image as it may be expired.

// Remove below error when and if it's fixed. Validators will remove the link
error: 'Unfortunatelly Instagram\'s OG image is cropped as of 2023-10-11 and as of 2024-02-02'
error: oembed.is_fallback ? null : 'Unfortunatelly Instagram\'s OG image is cropped as of 2023-10-11 and as of 2024-02-02'
});
}

Expand Down
64 changes: 64 additions & 0 deletions plugins/domains/loom.com.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
export default {

re: /^https?:\/\/(?:www\.)?loom\.com\/share\//i,

mixins: ['*', 'domain-icon'],

getLink: function(iframe, query, twitter, options) {

if (!iframe.width || !iframe.height) {
return;
}

const width = twitter.player?.width || iframe.width;
const height = twitter.player?.height || iframe.height;

var hideinfo = options.getRequestOptions('loom.hideinfo',
!options.getProviderOptions('players.showinfo', true)
) || query._hideinfo === "true" || !!query._hideinfo;

if (hideinfo) {
query.hide_owner = true;
query.hide_share = true;
query.hide_title = true;
query.hideEmbedTopBar = true;
}

// Otherwise take only parameters from /embed redirect to /share....
// but clean them up when user requests via request option
var q = {};
if (options.getRequestOptions('loom.hideinfo') !== false) {
Object.keys(query).forEach(function(key) {
if (/^hide/.test(key)) {
q[key] = query[key];
if (!hideinfo) {
hideinfo = true;
}
}
});
}

return {
href: iframe.replaceQuerystring(q),
type: CONFIG.T.text_html, // Validator fails because we receive x-frame-options. It actually works fine.
rel: CONFIG.R.player,
'aspect-ratio': width / height,
options: {
hideinfo: {
value: hideinfo,
label: "Hide player attribution info"
}
}
}

},

tests: [
// redirects here with the query-string:
'https://www.loom.com/embed/e5b8c04bca094dd8a5507925ab887002?hide_owner=true&hide_share=true&hide_title=true&hideEmbedTopBar=true',
'https://www.loom.com/share/0808e55f94a24992b2de488ac56d3815?_hideinfo=true',
'https://www.loom.com/share/0808e55f94a24992b2de488ac56d3815',
'https://www.loom.com/share/7f68fa7f01e349cab91b0c36168f68c3'
]

};

0 comments on commit c220d7f

Please sign in to comment.