Updated:
The fullscreen feature you are trying to omit of youtube is coded in ActionScript in their player. JW Player does not offer this feature. However you can set full screen without measuring the window'
s height and width like this:
jwplayer('mediaspace').setup({
'flashplayer': '/jwplayer/player.swf',
'width': '100%',
'height': '100%',
});
One trick is too trigger browser default player by linking the direct video link on a link somewhere or on the double click of the player (can be easily done using jQuery)
Another trick is too trigger the full screen of browser as shown here
Earlier Answer:
If you attempting to resize the player based on the screen's dimension, make sure you are getting the values after the document is loaded and that plugin is initiated after wards.
$(function() {
var player_width = $(window).width();
var player_height = $(window).height();
//After this initiate the plugin
});
Except this, there is nothing wrong with your code.