Java* Media Framework Tutorial - Lesson 3ADownload Status
This applet has a progress bar that displays how much of the media file has downloaded. If you are viewing the AVI file locally, you won't see the progress bar. It is shown in Figure 1.
Fig. 1 Download Progress Bar To make this applet, we used JMFs CachingControl interface. Calling getProgressBarComponent() on a CachingControl object returns an AWT component containing a progress bar like the one above. getContentLength(), another method of the CachingControl interface, returns the total size in bytes of the URL currently being downloaded. A CachingControlEvent is sent to indicate each change in the value returned by getContentProgress(). The CachingControlEvent object has the following methods:
Returns the CachingControl object for which the CachingControlEvent is being delivered.
Returns the number of bytes already read during the current URL download. CachingControlEvent is a subclass of ControllerEvent and is handled by controllerUpdate(), like all other Controller events.
This page was last updated on Feb 11th, 1997.
|