Resizing non-flash player
![]() ![]() |
Above the video, next to the title, is a button used to make the video player bigger. I wanted this to work with your great script, so I added it! These changes allow the non-flash video player to resize using youtube's button First, I changed the writePlayerxx() functions to:
playerDiv.innerHTML = '<embed id="no-flash-player" type="application/x-mplayer2"... resizePlayer(); and added this at the end of the script:
function resizePlayer() {
var player = document.getElementById('no-flash-player');
if (!(player == null)) {
if (unsafeWindow._hasclass(unsafeWindow._gel('baseDiv'), 'watch-wide-mode')) {
player.width = 960;
player.height = 582;
} else {
player.width = 640;
player.height = 388;
}
}
}
document.getElementById('player-toggle-switch').addEventListener('click', resizePlayer, false);
resizePlayer();
the unsafeWindow._hasclass(unsafeWindow._gel('baseDiv'), 'watch-wide-mode') is used to see if the player is widescreen or not. Hope you include this and keep up the good work! |
![]() ![]() |
Thanks for the patch, works great. I included it in the current version. |
![]() ![]() |
Glad I could help |
![]() ![]() |
Left-clicking toggles between full-screen and whatever size
|




