Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MediaElement (version 2.16.4) iframe fullscreen video issue - firefox, IE11 #1484

Closed
jalam1 opened this issue May 2, 2015 · 2 comments
Closed

Comments

@jalam1
Copy link

jalam1 commented May 2, 2015

I'm using mediaelement.js version 2.16.4 to load video in an iframe created by thickbox.js. When I try to click fullscreen button in firefox-37.0.2/IE-11 the video goes to fullscreen but immediately goes back to smaller size of the iframe. If I don't initialize mediaelement and only the HTML5 tag then the fullscreen works fine in an iframe. So, it has to do something with the mediaelement player. This doesn't happen in Chrome! I have "webkitallowfullscreen mozallowfullscreen allowfullscreen" in the iframe.

Stackoverflow : http://stackoverflow.com/questions/29969335/mediaelement-version-2-16-4-iframe-fullscreen-video-issue-firefox-ie11

I found the issue of fullscreen in firefox/IE. It's the following code in mediaelement-and-player.js where there is a manual exit from fullscreen. For me the 'zoomMultiplier' variable is 1.25 which is causing the problem.

if (t.isInIframe) {
// sometimes exiting from fullscreen doesn't work
// notably in Chrome <iframe>. Fixed in version 17
setTimeout(function checkFullscreen() {

                    if (t.isNativeFullScreen) {
                        var zoomMultiplier = window["devicePixelRatio"] || 1;
                        // Use a percent error margin since devicePixelRatio is a float and not exact.
                        var percentErrorMargin = 0.002; // 0.2%
                        var windowWidth = zoomMultiplier * $(window).width();
                        var screenWidth = screen.width;
                        var absDiff = Math.abs(screenWidth - windowWidth);
                        var marginError = screenWidth * percentErrorMargin;

                        // check if the video is suddenly not really fullscreen
                        if (absDiff > marginError) {
                            // manually exit
                            t.exitFullScreen();
                        } else {
                            // test again
                            setTimeout(checkFullscreen, 500);
                        }
                    }


                }, 500);
            }
@rafa8626
Copy link
Contributor

rafa8626 commented Aug 1, 2016

@jalam1 Is this still an issue?

@rafa8626
Copy link
Contributor

Closing this issue since no answer has been posted in more than 2 weeks. If you'd like to reopen this, let us know. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants