modules/media/src/main/java/com/sun/media/jfxmedia/locator/Locator.java

Print this page

       

*** 227,242 **** if (HostUtils.isIOS() && protocol.equals("ipod-library")) { isIpod = true; } // Verify the protocol is supported. ! if (!isIpod && !protocol.equals("file") && !protocol.equals("http")) { throw new UnsupportedOperationException("Unsupported protocol \"" + protocol + "\""); } // Check if we can block ! if (protocol.equals("http")) { canBlock = true; } // Set instance variable. this.uri = uri; --- 227,242 ---- if (HostUtils.isIOS() && protocol.equals("ipod-library")) { isIpod = true; } // Verify the protocol is supported. ! if (!isIpod && !MediaManager.canPlayProtocol(protocol)) { throw new UnsupportedOperationException("Unsupported protocol \"" + protocol + "\""); } // Check if we can block ! if (protocol.equals("http") || protocol.equals("https")) { canBlock = true; } // Set instance variable. this.uri = uri;
*** 341,351 **** 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")) { // Map http:/somepath to http://somepath uriString = uriString.replaceFirst("/", "//"); } } --- 341,351 ---- 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") || protocol.equals("https")) { // Map http:/somepath to http://somepath uriString = uriString.replaceFirst("/", "//"); } }
*** 384,394 **** boolean isMediaSupported = true; if (!isIpod) { for (int numConnectionAttempts = 0; numConnectionAttempts < MAX_CONNECTION_ATTEMPTS; numConnectionAttempts++) { try { // Verify existence. ! if (scheme.equals("http")) { // Check ability to connect, trying HEAD before GET. LocatorConnection locatorConnection = getConnection(uri, "HEAD"); if (locatorConnection == null || locatorConnection.connection == null) { locatorConnection = getConnection(uri, "GET"); } --- 384,394 ---- boolean isMediaSupported = true; if (!isIpod) { for (int numConnectionAttempts = 0; numConnectionAttempts < MAX_CONNECTION_ATTEMPTS; numConnectionAttempts++) { try { // Verify existence. ! 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"); }