通过HTTPS的JavaFX.MediaPlayer? [英] JavaFX.MediaPlayer over HTTPS?
问题描述
我尝试使用MediaPlayer播放定义了HTTPS网址的资源,并说它不支持协议。
I tried to use MediaPlayer to play back a resource defined an HTTPS url, and it says protocol not supported.
在API参考中,他们声明了FILE / HTTP / JAR是受支持的协议(未提及HTTPS)。
In the API reference they state FILE/HTTP/JAR are supported protocols (HTTPS not mentioned).
是否可以通过HTTPS以某种方式使用URL?在我看来,这似乎是一个很大的缺点...
Is it possible to somehow use urls via HTTPS? This seems quite a big drawback in my opinion...
推荐答案
这是为Java 9修复的,后来又向后移植到Java 8因此,Java 8更新91及更高版本应该使用HTTPS URL而不会出现问题。
This was fixed for Java 9, and later backported to Java 8. Java 8 update 91 and later should therefore be working with HTTPS URLs without an issue.
如果您使用的是不支持它的旧版Java,然后不幸的是,你唯一的选择是通过HTTPS将文件复制到本地临时文件,然后播放。
If you're using an old version of Java that doesn't support it, then unfortunately the only option you have is to copy the file over HTTPS to a local temporary file, then play that.
这篇关于通过HTTPS的JavaFX.MediaPlayer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!