guancio / ChromeOsSubtitle

ChromeOsSubtitle video player
63 stars 33 forks source link

Mouse pointer present during playback #67

Closed Stangoesagain closed 8 years ago

Stangoesagain commented 8 years ago

I manually fixed this with the earlier version by editing one of the js files but it should really be done here once and for all. I can look up that old edit but you guys should know where it is by heart.

Also it used to be only in fullscreen view but now the pointer is there even in window.

vivekannan commented 8 years ago

I was under the impression that a bug in Chrome browser prevented the cursor from hiding. Can you share the edit you made?

Stangoesagain commented 8 years ago

There used to be a file called mep-feature-fullscreen.js (at least that's the name of the copy I saved locally) and I added a few lines there. This file is not present in new version and I'm not sure yet where I can insert a similar edit.

Here's modified part of that old file, from the beginning:

$.extend(mejs.MepDefaults, {
    usePluginFullScreen: true,
    newWindowCallback: function() { return '';},
    fullscreenText: mejs.i18n.t('Fullscreen')
});

$.extend(MediaElementPlayer.prototype, {

    isFullScreen: false,

    isNativeFullScreen: false,

    docStyleOverflow: null,

    isInIframe: false,

    buildfullscreen: function(player, controls, layers, media) {

        if (!player.isVideo)
            return;

        player.isInIframe = (window.location != window.parent.location);

        // native events
        if (mejs.MediaFeatures.hasTrueNativeFullScreen) {

            // chrome doesn't alays fire this in an iframe
            var func = function(e) {

                if (mejs.MediaFeatures.isFullScreen()) {
                    player.isNativeFullScreen = true;
                    // reset the controls once we are fully in full screen
                    player.setControlsSize();

//------------------ Hide Cursor -----------//

var idleMouseTimer; var forceMouseHide = false;

$("body").css('cursor', 'none');

$("#main").mousemove(function(ev) { if(!forceMouseHide) { $("body").css('cursor', '');

    clearTimeout(idleMouseTimer);

    idleMouseTimer = setTimeout(function() {
        $("body").css('cursor', 'none');

        forceMouseHide = true;
        setTimeout(function() {
            forceMouseHide = false;
        }, 200);
    }, 2000);
}

});

//----------- end of Hide Cursor -----------//

                } else {
                    player.isNativeFullScreen = false;
                    // when a user presses ESC
                    // make sure to put the player back into place
                    player.exitFullScreen();
                }
            };

....

vivekannan commented 8 years ago

The problem in Chrome is that when you set cursor to 'none', it isn't applied until the user moves the mouse. If he moves the mouse (after 200 milliseconds), then it appears again as cursor is set to '' as per your code. I tried more or less the same thing but it didn't work no matter what I tried. Then I came across the chrome bug. It's been a bug for a looong time, so I don't think google considers it to be a bug.

On Fri, Sep 2, 2016 at 7:39 PM, Stangoesagain notifications@github.com wrote:

There used to be a file called mep-feature-fullscreen.js (at least that's the name of the copy I saved locally) and I added a few lines there. This file is not present in new version and I'm not sure yet where I can insert a similar edit.

Here's modified part of that old file, from the beginning:

$.extend(mejs.MepDefaults, { usePluginFullScreen: true, newWindowCallback: function() { return '';}, fullscreenText: mejs.i18n.t('Fullscreen') });

$.extend(MediaElementPlayer.prototype, {

isFullScreen: false,

isNativeFullScreen: false,

docStyleOverflow: null,

isInIframe: false,

buildfullscreen: function(player, controls, layers, media) {

    if (!player.isVideo)
        return;

    player.isInIframe = (window.location != window.parent.location);

    // native events
    if (mejs.MediaFeatures.hasTrueNativeFullScreen) {

        // chrome doesn't alays fire this in an iframe
        var func = function(e) {

            if (mejs.MediaFeatures.isFullScreen()) {
                player.isNativeFullScreen = true;
                // reset the controls once we are fully in full screen
                player.setControlsSize();

//------------------ Hide Cursor -----------//

var idleMouseTimer; var forceMouseHide = false;

$("body").css('cursor', 'none');

$("#main").mousemove(function(ev) { if(!forceMouseHide) { $("body").css('cursor', '');

clearTimeout(idleMouseTimer);

idleMouseTimer = setTimeout(function() {
    $("body").css('cursor', 'none');

    forceMouseHide = true;
    setTimeout(function() {
        forceMouseHide = false;
    }, 200);
}, 2000);

}

});

//----------- end of Hide Cursor -----------//

            } else {
                player.isNativeFullScreen = false;
                // when a user presses ESC
                // make sure to put the player back into place
                player.exitFullScreen();
            }
        };

....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/guancio/ChromeOsSubtitle/issues/67#issuecomment-244385262, or mute the thread https://github.com/notifications/unsubscribe-auth/AHkl-h3HjOGuXP37xvMDetmgwzmh4ZQXks5qmC4sgaJpZM4Jx2WZ .

Stangoesagain commented 8 years ago

I didn't know it was a bug, I just found some code, incidentally here on Github, and pasted it in. Is it possible to do something similar with the new version?

On Sat, Sep 3, 2016 at 12:47 AM, Vivek Kannan notifications@github.com wrote:

The problem in Chrome is that when you set cursor to 'none', it isn't applied until the user moves the mouse. If he moves the mouse (after 200 milliseconds), then it appears again as cursor is set to '' as per your code. I tried more or less the same thing but it didn't work no matter what I tried. Then I came across the chrome bug. It's been a bug for a looong time, so I don't think google considers it to be a bug.

On Fri, Sep 2, 2016 at 7:39 PM, Stangoesagain notifications@github.com wrote:

There used to be a file called mep-feature-fullscreen.js (at least that's the name of the copy I saved locally) and I added a few lines there. This file is not present in new version and I'm not sure yet where I can insert a similar edit.

Here's modified part of that old file, from the beginning:

$.extend(mejs.MepDefaults, { usePluginFullScreen: true, newWindowCallback: function() { return '';}, fullscreenText: mejs.i18n.t('Fullscreen') });

$.extend(MediaElementPlayer.prototype, {

isFullScreen: false,

isNativeFullScreen: false,

docStyleOverflow: null,

isInIframe: false,

buildfullscreen: function(player, controls, layers, media) {

if (!player.isVideo) return;

player.isInIframe = (window.location != window.parent.location);

// native events if (mejs.MediaFeatures.hasTrueNativeFullScreen) {

// chrome doesn't alays fire this in an iframe var func = function(e) {

if (mejs.MediaFeatures.isFullScreen()) { player.isNativeFullScreen = true; // reset the controls once we are fully in full screen player.setControlsSize();

//------------------ Hide Cursor -----------//

var idleMouseTimer; var forceMouseHide = false;

$("body").css('cursor', 'none');

$("#main").mousemove(function(ev) { if(!forceMouseHide) { $("body").css('cursor', '');

clearTimeout(idleMouseTimer);

idleMouseTimer = setTimeout(function() { $("body").css('cursor', 'none');

forceMouseHide = true; setTimeout(function() { forceMouseHide = false; }, 200); }, 2000); }

});

//----------- end of Hide Cursor -----------//

} else { player.isNativeFullScreen = false; // when a user presses ESC // make sure to put the player back into place player.exitFullScreen(); } };

....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/guancio/ChromeOsSubtitle/issues/67# issuecomment-244385262, or mute the thread https://github.com/notifications/unsubscribe-auth/AHkl- h3HjOGuXP37xvMDetmgwzmh4ZQXks5qmC4sgaJpZM4Jx2WZ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/guancio/ChromeOsSubtitle/issues/67#issuecomment-244442839, or mute the thread https://github.com/notifications/unsubscribe-auth/ARzrYl18fEuYSosV6AaQ7TrsyBo6vf4rks5qmGFJgaJpZM4Jx2WZ .

vivekannan commented 8 years ago

As far as I know, nope. Again, some really, really nasty code might work....but I am not willing to go that far. I will keep looking for solutions.

On Wed, Sep 7, 2016 at 6:41 PM, Stangoesagain notifications@github.com wrote:

I didn't know it was a bug, I just found some code, incidentally here on Github, and pasted it in. Is it possible to do something similar with the new version?

On Sat, Sep 3, 2016 at 12:47 AM, Vivek Kannan notifications@github.com wrote:

The problem in Chrome is that when you set cursor to 'none', it isn't applied until the user moves the mouse. If he moves the mouse (after 200 milliseconds), then it appears again as cursor is set to '' as per your code. I tried more or less the same thing but it didn't work no matter what I tried. Then I came across the chrome bug. It's been a bug for a looong time, so I don't think google considers it to be a bug.

On Fri, Sep 2, 2016 at 7:39 PM, Stangoesagain notifications@github.com wrote:

There used to be a file called mep-feature-fullscreen.js (at least that's the name of the copy I saved locally) and I added a few lines there. This file is not present in new version and I'm not sure yet where I can insert a similar edit.

Here's modified part of that old file, from the beginning:

$.extend(mejs.MepDefaults, { usePluginFullScreen: true, newWindowCallback: function() { return '';}, fullscreenText: mejs.i18n.t('Fullscreen') });

$.extend(MediaElementPlayer.prototype, {

isFullScreen: false,

isNativeFullScreen: false,

docStyleOverflow: null,

isInIframe: false,

buildfullscreen: function(player, controls, layers, media) {

if (!player.isVideo) return;

player.isInIframe = (window.location != window.parent.location);

// native events if (mejs.MediaFeatures.hasTrueNativeFullScreen) {

// chrome doesn't alays fire this in an iframe var func = function(e) {

if (mejs.MediaFeatures.isFullScreen()) { player.isNativeFullScreen = true; // reset the controls once we are fully in full screen player.setControlsSize();

//------------------ Hide Cursor -----------//

var idleMouseTimer; var forceMouseHide = false;

$("body").css('cursor', 'none');

$("#main").mousemove(function(ev) { if(!forceMouseHide) { $("body").css('cursor', '');

clearTimeout(idleMouseTimer);

idleMouseTimer = setTimeout(function() { $("body").css('cursor', 'none');

forceMouseHide = true; setTimeout(function() { forceMouseHide = false; }, 200); }, 2000); }

});

//----------- end of Hide Cursor -----------//

} else { player.isNativeFullScreen = false; // when a user presses ESC // make sure to put the player back into place player.exitFullScreen(); } };

....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/guancio/ChromeOsSubtitle/issues/67# issuecomment-244385262, or mute the thread https://github.com/notifications/unsubscribe-auth/AHkl- h3HjOGuXP37xvMDetmgwzmh4ZQXks5qmC4sgaJpZM4Jx2WZ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/guancio/ChromeOsSubtitle/issues/67# issuecomment-244442839, or mute the thread https://github.com/notifications/unsubscribe-auth/ ARzrYl18fEuYSosV6AaQ7TrsyBo6vf4rks5qmGFJgaJpZM4Jx2WZ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/guancio/ChromeOsSubtitle/issues/67#issuecomment-245275372, or mute the thread https://github.com/notifications/unsubscribe-auth/AHkl-jd6313n5PZcBRPsa3M8LGkDWyXsks5qnrfqgaJpZM4Jx2WZ .

vivekannan commented 8 years ago

Closing this as a wontFix bug. Will keep looking for solutions.

vivekannan commented 8 years ago

I was wrong! Automatically started working somehow. Will be a part of 1.14.0.