Archived:VideoControl.getDisplayWidth() returns null in S60 3rd Edition devices (Known Issue)
The method videoControl.getDisplayWidth() works with Nokia 6680, S60 2nd Edition - but S60 3rd Edition devices return null.
Reading the value of videoControl.getDisplayWidth() in canvas returns null in S60 3rd Edition devices.
How to reproduce
If there is an instance of videoControl named "video", read the value of video.getDisplayWidth() and display output to user. This should return null. To confirm the problem, use the following method:
x = video.getSourceWidth();
y = video.getSourceHeight();
Set the the DisplaySize manually with the following line:
After this video.getDisplayWidth() should return a value (set to be the same as sourceWidth). It depends on the device whether it is equal or a few pixels less than the actual width of the current render would otherwise be. For example in the Nokia 6680 (where this problem does not occur), the original DisplayWidth is 160 and the sourceWidth returns value 156 for the used test video.