embyLaunchPotplayer

try to take over the world!

2020-07-10 일자. 최신 버전을 확인하세요.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name         embyLaunchPotplayer
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @include	     *:8096*
// @grant        none
// @require      https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// ==/UserScript==


 new MutationObserver(function(mutations) {
    if(document.querySelector('.mainDetailButtons')){
        var mainDetailButtons = document.querySelector('.mainDetailButtons');
        if(mainDetailButtons){
              var html = mainDetailButtons.innerHTML;
              mainDetailButtons.innerHTML = html+'<button is="emby-button" id="potPlayer" type="button" class="detailButton detailButton-hidemobile emby-button" data-mode="play"> <div class="detailButton-content"> <i class="md-icon detailButton-icon"></i>  <div class="detailButton-text playButtonText">PotPlayer</div> </div> </button>';
           this.disconnect(); // disconnect the observer
        }
    }
 }).observe(document, {childList: true, subtree: true});

$(document).on('click', '#potPlayer', function(e) {
    var b = $("span.mediaInfoLabel:contains('路径')").siblings('span')[0];
    var url="emby://"+b.innerHTML;
    window.location.href=url;
})