isFullscreen public property

nis's Avatar

nis

10 Sep, 2012 06:50 PM

Hello.

I am having trouble calling the isFullscreen property. It is always undefined, although I can call properties like numSlides without any hassle.

What I want to achieve with this is to know when the slider is in fullscreen so that I can hide some elements that are giving me a hard time across many browsers.

My code:

// RS init, $activeSlider is a jQuery wrapped element that is the slider
var sliderInstance = $activeSlider.royalSlider( royalSliderOptions ).data('royalSlider');

// Logging out properties 
console.log('numSlides: ' + sliderInstance.numSlides); // returns the correct amount of slides
console.log('isFullscreen: ' + sliderInstance.isFullscreen); // returns 'undefined'
  1. Support Staff 1 Posted by Dmitry Semenov on 11 Sep, 2012 07:32 AM

    Dmitry Semenov's Avatar

    Hello,

    It was added in Fullscreen module v1.0.1, get latest version from build tool - http://dimsemenov.com/private/home.php

    Dmitry

  2. 2 Posted by Tomas on 11 Sep, 2012 07:47 AM

    Tomas's Avatar

    Hello again.
    Thank you for your fast reply.
    I have the latest build included in my code.
    The problem is (as I found out this morning) that the 'isFullscreen' property is undefined until I have called the fullscreen api at least once.
    E.g if I call the 'isFullscreen' property immediatly after the slider initializes, it is undefined. If I click the fullscreen button, and call the property again on the click event, it is still undefined. But if I call it on my second click (fullscreen exit), it returns isFullscreen = true (when in fact it should be false). So my theory is that the fullscreen api is not initialized with the slider it self..? And therefore is undefined until it is called.

    Would be pretty awesome to be able to call the isFullscreen property on slider init.

  3. 3 Posted by Tomas on 11 Sep, 2012 08:28 AM

    Tomas's Avatar

    I have a correction to my post before.
    The 'isFullscreen' property is undefined in Chrome and Firefox, but not in IE. It shows correctly in IE, even the state when fullscreen is exited is false and not true like in Chrome and Firefox.
    I realize that this probably is a browser specific bug now.

  4. Support Staff 4 Posted by Dmitry Semenov on 11 Sep, 2012 09:13 AM

    Dmitry Semenov's Avatar

    I thought you meant that it always undefined. This is how it's done, property isn't set until fullscreen is launched, why use extra memory.

    Any reason why you need different behaviour?

    Dmitry

  5. 5 Posted by Tomas on 13 Sep, 2012 07:34 AM

    Tomas's Avatar

    Thanks for your replies.

    I created my own fullscreen listener that isn't dependent on the fullscreen api.

    Another thing that would be nice, is more properties from the youtube api, to listen on of the the video is playing or not etc.. In my case, I would like to hide some elements when the video is playing that are hovering over the video.

  6. nis closed this discussion on 05 Dec, 2012 09:44 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac