JavaFX.MediaPlayer over HTTPS?

烈酒焚心 提交于 2020-01-01 04:56:26

问题


I tried to use MediaPlayer to play back a resource defined an HTTPS url, and it says protocol not supported.

In the API reference they state FILE/HTTP/JAR are supported protocols (HTTPS not mentioned).

Is it possible to somehow use urls via HTTPS? This seems quite a big drawback in my opinion...


回答1:


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.

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://stackoverflow.com/questions/14725473/javafx-mediaplayer-over-https

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!