linkedIn learning video download

Allows to download learning videos you see on LinkedIn. Must be logged in.

< 脚本 linkedIn learning video download 的反馈

评价:好评 - 脚本运行良好

§
发布于:2018-12-13

Move the download button to the bottom menu

Why didn't you move the DL button to the bottom menu, so that we can watch full screen? Here is the code, simplified and changed:

$('body').ready(function(){ (function() { var download_button = <div class="video-player__toolbar-menu"> <button id="dlbtn" title="Download video" class="add-menu-dropdown__trigger btn-tertiary btn-large dropdown-trigger ember-view"> <span class="text" aria-hidden="true">DL</span> <span class="visually-hidden">DL Vid</span> </button></div>; addDownloadButton = function(){ $('.ssplayer-right-actions').prepend(download_button); $('#dlbtn').wrap(''); $('#dlbtn').unbind(); $('#dlbtn').children().unbind(); }; checkIfReadyToLoad = function(){ if($('.ssplayer-right-actions').length && $('#dlbtn').length == 0){ addDownloadButton(); } else{ setTimeout(checkIfReadyToLoad,1000); } }; checkIfReadyToLoad(); checkForVideoPlayer = function(){ if($('.video-container video').length){ var vid_source = $('video').attr('src'); $('#dllink').attr('href', vid_source); var vid_name = vid_source; $('#dllink').attr('download', vid_name); } else { } }; $('body').on('mouseover', '#dlbtn', function(){ checkForVideoPlayer(); }); $('body').on('mouseover', '.course-body__content', function(){ checkIfReadyToLoad(); });

})();

});

发布留言

登录以发布留言。