aj_nsc
11-10-2010, 06:10 AM
So I'm coding out my own video control bar with HTML/CSS/Javascript for JW Player and I added a fullscreen button. It's only a 'fake' fullscreen button that positions the flash player in a fixed div 100% width and height of the screen. The button toggles the fake fullscreen so that it goes from being a fixed position with 100% width and height to an absolute positioned div with the dimensions of it's container.
I'm coming across a problem in IE7, where that when the JW Player goes fullscreen and then resizes, it's dimensions are wrong. The player is still at fullscreen width and height, but positioned absolutey inside it's containing element which gives it a weird look.
See the problem here - http://partyongeorge.ca/template/index6.php
Here's the resize code:
var ID_ = '#'+this._videoId;
var width_ = this._controls.bar.width();
//set overflow:visible on #featured and #main_wrapper
//if fullscreen = true - make it fullscreen and removeClass('active') and addClass('inactive');
//if fullscreen = false - resize it to the original size and removeClass('inacitve') and addClass('active')
if(fullscreen) {
$('#featured, #main_wrapper').css('overflow','visible');
$(ID_).addClass('fullscreen');
this._jw.resize($(window).width(),$(window).height());
this._controls.bar.css('position','fixed').css('width',width_+'px').css('left',($(window).width()-width_)/2+'px');
this._controls.fullscreen.removeClass('active').removeClass('inactive').addClass('inactive').attr('t itle','Exit Fullscreen');
} else {
$('#featured, #main_wrapper').css('overflow','hidden');
$(ID_).removeClass('fullscreen');
this._jw.resize(966,438);
this._controls.bar.css('position','absolute').css('width','100%').css('left',0);
this._controls.fullscreen.removeClass('inactive').removeClass('active').addClass('active').attr('tit le','Show Fullscreen');
}
and here's the css for the element with class fullscreen and with the fullscreen class:
#video {
width: 966px;
height: 438px;
position: absolute;
top:0;
left:0;
z-index: 1;
}
#video.fullscreen {
position: fixed;
width: 100%;
height: 100%;
background-color: #000;
}
Right now, I think my only option is to disabled my custom fullscreen button in IE7.
I'm coming across a problem in IE7, where that when the JW Player goes fullscreen and then resizes, it's dimensions are wrong. The player is still at fullscreen width and height, but positioned absolutey inside it's containing element which gives it a weird look.
See the problem here - http://partyongeorge.ca/template/index6.php
Here's the resize code:
var ID_ = '#'+this._videoId;
var width_ = this._controls.bar.width();
//set overflow:visible on #featured and #main_wrapper
//if fullscreen = true - make it fullscreen and removeClass('active') and addClass('inactive');
//if fullscreen = false - resize it to the original size and removeClass('inacitve') and addClass('active')
if(fullscreen) {
$('#featured, #main_wrapper').css('overflow','visible');
$(ID_).addClass('fullscreen');
this._jw.resize($(window).width(),$(window).height());
this._controls.bar.css('position','fixed').css('width',width_+'px').css('left',($(window).width()-width_)/2+'px');
this._controls.fullscreen.removeClass('active').removeClass('inactive').addClass('inactive').attr('t itle','Exit Fullscreen');
} else {
$('#featured, #main_wrapper').css('overflow','hidden');
$(ID_).removeClass('fullscreen');
this._jw.resize(966,438);
this._controls.bar.css('position','absolute').css('width','100%').css('left',0);
this._controls.fullscreen.removeClass('inactive').removeClass('active').addClass('active').attr('tit le','Show Fullscreen');
}
and here's the css for the element with class fullscreen and with the fullscreen class:
#video {
width: 966px;
height: 438px;
position: absolute;
top:0;
left:0;
z-index: 1;
}
#video.fullscreen {
position: fixed;
width: 100%;
height: 100%;
background-color: #000;
}
Right now, I think my only option is to disabled my custom fullscreen button in IE7.