Skip to content

Commit

Permalink
Merge pull request #1012 from GrosPoulet/master
Browse files Browse the repository at this point in the history
New plug-in: screencast.com
  • Loading branch information
GrosPoulet authored Aug 26, 2022
2 parents ee62121 + 5d50408 commit 8e6923d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"plugins/medium_a.js",
"plugins/niconico_a.js",
"plugins/photoshop_a.js",
"plugins/screencast_a.js",
"plugins/squarespace_a.js",
"plugins/streamable_a.js",
"plugins/tiktok_a.js",
Expand Down
26 changes: 26 additions & 0 deletions plugins/screencast_a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'screencast_a',
version:'0.1',
prepareImgLinks:function (callback) {
var res = [];

// page with samples: https://www.reddit.com/domain/screencast.com/
// link: https://www.screencast.com/t/dXz0bSAkRg5u
// video url: https://content.screencast.com/users/RugcleaningChica/folders/Default/media/bb940e12-6e01-4b06-928e-88a10e137f36/Oriental_rug_Cleaning_Chicago.mp4
$('a[href*="/t/"]:not(.hoverZoomMouseover), a[href*="/users/"]:not(.hoverZoomMouseover)').filter(function() { return (/screencast\.com/.test($(this).prop('href'))) }).addClass('hoverZoomMouseover').one('mouseover', function() {

href = this.href;
link = $(this);

hoverZoom.prepareFromDocument($(this), this.href, function(doc) {

let meta = doc.querySelector('meta[property="og:video"]');
if (meta) return meta.content;

}, false); // get source sync
});

callback($(res), this.name);
}
});

0 comments on commit 8e6923d

Please sign in to comment.