modules/media/src/main/java/com/sun/media/jfxmedia/locator/Locator.java
Print this page
@@ -227,16 +227,16 @@
if (HostUtils.isIOS() && protocol.equals("ipod-library")) {
isIpod = true;
}
// Verify the protocol is supported.
- if (!isIpod && !protocol.equals("file") && !protocol.equals("http")) {
+ if (!isIpod && !MediaManager.canPlayProtocol(protocol)) {
throw new UnsupportedOperationException("Unsupported protocol \"" + protocol + "\"");
}
// Check if we can block
- if (protocol.equals("http")) {
+ if (protocol.equals("http") || protocol.equals("https")) {
canBlock = true;
}
// Set instance variable.
this.uri = uri;
@@ -341,11 +341,11 @@
if (firstSlash != -1 && uriString.charAt(firstSlash + 1) != '/') {
// Only one '/' after the ':'.
if (protocol.equals("file")) {
// Map file:/somepath to file:///somepath
uriString = uriString.replaceFirst("/", "///");
- } else if (protocol.equals("http")) {
+ } else if (protocol.equals("http") || protocol.equals("https")) {
// Map http:/somepath to http://somepath
uriString = uriString.replaceFirst("/", "//");
}
}
@@ -384,11 +384,11 @@
boolean isMediaSupported = true;
if (!isIpod) {
for (int numConnectionAttempts = 0; numConnectionAttempts < MAX_CONNECTION_ATTEMPTS; numConnectionAttempts++) {
try {
// Verify existence.
- if (scheme.equals("http")) {
+ if (scheme.equals("http") || scheme.equals("https")) {
// Check ability to connect, trying HEAD before GET.
LocatorConnection locatorConnection = getConnection(uri, "HEAD");
if (locatorConnection == null || locatorConnection.connection == null) {
locatorConnection = getConnection(uri, "GET");
}