Zing TV HTML5 Player Fix

Sửa player Zing TV trên Chrome

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Zing TV HTML5 Player Fix
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  Sửa player Zing TV trên Chrome
// @author       You
// @match        http://tv.zing.vn/video/*
// @grant        none
// ==/UserScript==
function loadJwPlayer(playerId,playerOption){
    var jw_js=document.getElementById('jw_js');
      if(typeof jw_js=='undefined'||jw_js==null){
        var head= document.getElementsByTagName('head')[0];
        var script= document.createElement('script');
        script.type= 'text/javascript';
        script.id="jw_js";
        script.src= 'https://content.jwplatform.com/libraries/QHJ5Iarr.js';
        //script.src='/js/jwplayer/jwplayer.js';
        head.appendChild(script);
        this.interval=setInterval(()=>{
          if (typeof jwplayer != 'undefined') {          
            jwplayer(playerId).setup(playerOption);
            clearInterval(this.interval);
          }
        },500);
      }
      else jwplayer(playerId).setup(playerOption);
}
(function() {
    if(navigator.userAgent.match(/Chrome/).length>0){        
    var script=$('script').text();
    var video_link=script.match(/http.*?.mp4/g);
    var sources=[];
    var quality=['360p','480p','720p'];
    for(var i=0;i<video_link.length;i++){
       sources.push({'file': video_link[i],'label': quality[i]});
	}
    console.log(sources);
    document.querySelector('._insideBackground').id='player';
    document.querySelector('._insideBackground').innerHTML='';
    loadJwPlayer('player',{'sources': sources,'autostart': true});
    }

})();