Archived:RTSP-streamed video has incorrect display size using Java ME on S60 3rd Edition (Known Issue)
If the prefetch() method is called explicitly, video display size cannot be obtained early enough or at all from an RTSP stream. In this case a default size of 32*32 pixels is substituted for the source size. However, this does not affect the real stream anyway (for example, real stream dimensions are still the original), it is only that VideoControl.getSourceWidth() and getSourceHeight() return incorrect values.
Regardless of what VideoControl.getSourceWidth() and getSourceHeight() return, you can request the video to be shown in the original size or in any other size (for example, by calling VideoControl.setDisplaySize( 176, 144 )). This means that the preferable solution for this problem is to set the video display size to a predefined size, regardless of what getSourceWidth()/getSourceHeight() methods return.
If the prefetch() method is not called explicitly, the video will be displayed in the original size.
How to reproduce
See the attached applications for a reproduction of the problem.
- For video 1) option "Start no prefetch" displays the video in its original size, while "Start with prefetch" displays the video as a tiny 32x32 square.
- For video 2) both options work correctly. The behavior described above occurs only in some videos, not in all of them.
In order to overcome this problem, do not use the prefetch() method and do not resize the video using setDisplaySize(), and place the video in the center of the Canvas only after the player is started.
This can be achieved by implementing a PlayerListener and replacing the video location only when it is in the STARTED state. One example of the implementation is: