JDK-8123986 : JavaFx MediaPlayer not release the file handle for the file it played Window specific
  • Type: Bug
  • Component: javafx
  • Sub-Component: media
  • Affected Version: 7u10,7u40
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-01-15
  • Updated: 2015-07-15
  • Resolved: 2013-05-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u40Fixed 8Fixed
Related Reports
Relates :  
Relates :  
Description
Hi,

There is no way to unload video file from the MediaPlayer.
MediaPlayer holds the file handle for the file which it played.
Suppose I have some of the video file a.mp4,b.mp4,c.mp4,d.mp4.
If I load a.mp4 file and then again load the b.mp4 file and now I wants to delete a.mp4 file from my localHD, I am not able to delete the file as it is still being in used.

Is there any way to unload file from the MediaPlayer Object.

This bug is windows specific Working properly on Mac-OSX.
Comments
Calling dispose() method on MediaPlayer will release file handle.
09-05-2013

Opened files should be closed immediately when they are not used. And not during GC. 1) number of opened files is limited. 2) On windows you cannot delete opened file. So I think this is reproducible.
28-02-2013

I cannot reproduce this issue. See attached sample app. Press Load button twice and then GC button several times and media file can be delete. Media file will not be released until MediaPlayer is garbage collected.
28-02-2013

Will any work around you find guys. If I had done something wrong please tell.I also checked this with JavaFx 2.2.6(Build 4 and 8) beta version the problem still persists. Please help.
23-01-2013