Greasy Fork is available in English.
try to take over the world!
当前为
// ==UserScript==
// @name embyLaunchPotplayer
// @namespace http://tampermonkey.net/
// @version 0.5
// @description try to take over the world!
// @author You
// @include *:8*
// @grant none
// @require https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// ==/UserScript==
var timer = setInterval(function() {
var potplayer = $("div[is='emby-scroller']:not(.hide) .potplayer")[0];
if(!potplayer){
var mainDetailButtons = $("div[is='emby-scroller']:not(.hide) .mainDetailButtons")[0];
if(mainDetailButtons){
var html = mainDetailButtons.innerHTML;
mainDetailButtons.innerHTML = html+'<button is="emby-button" id="potPlayer" type="button" class="detailButton detailButton-hidemobile emby-button potplayer" > <div class="detailButton-content"> <i class="md-icon detailButton-icon"></i> <div class="detailButton-text">PotPlayer</div> </div> </button>';
}
}
}, 1000)
$(document).on('click', '#potPlayer', function(e) {
var mediaUrl = $("div[is='emby-scroller']:not(.hide) span.mediaInfoAttributeLabel:contains('路径')").siblings('span')[0];
var url="emby://"+mediaUrl.innerHTML;
window.location.href=url;
})