vuthanhcuonggmail.com / Auto Next Phim

// ==UserScript==
// @name         Auto Next Phim
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       vantruong2412
// @license      MIT
// @match        https://animemoi.org
// @include        /.*://.*phimmoi.net/phim/?/
// @include        /.*://.*phimmoi.net/phim/?$/
// @run-at       document-start
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @grant        none

// ==/UserScript==

(function() {
    'use strict';



$(document).ready(function () {

    $('#watching-messbox-close').click();

    var duratTion = 0; var _timePase = 0;
    setTimeout(function () {
        duratTion = jwplayer('media-player').getDuration();
        _timePase = parseInt(duratTion) - 100;
        setTimeout(function () {
            jwplayer('media-player').seek(220);
            setTimeout(function () {
              
                jwplayer('media-player').setFullscreen(true);
            }, 1000);

        }, 500);
        console.log(_timePase);
    }, 8000);
    jwplayer('media-player').on('complete', function () {
        var _check = document.getElementById('autonext-overlay').length;
        if (_check > 0) { $('#btn-autonext-force').click(); }
        console.log('done');
    });
    var currentPage = window.location.href;
    setInterval(function () {

        if (currentPage !== window.location.href) {
            currentPage = window.location.href;
            setTimeout(function () {
                duratTion = jwplayer('media-player').getDuration();
                _timePase = parseInt(duratTion) - 100;
                console.log(_timePase);
//                 var _check = $('#autonext-overlay').length;
//                 if (_check > 0) { setTimeout(function () { $('#btn-autonext-force').click(); }, _timePase * 1000); }

            }, 8000);
            setTimeout(function () {
                jwplayer('media-player').seek(220);
                jwplayer('media-player').setFullscreen(true);

            }, 1000);
        }
    }, 8000);


});


})();