PS3 Media Serverä¸ã®åç»ãiPhoneã§è¦ãããããã«ãã
æã家ã§ã¯X27Dã¹ã¢ãã¼ã³ã«CentOSãå ¥ãã¦ã¡ãã£ã¢ãµã¼ãã¼ã¨ãã¦éç¨ãã¦ãããã¯ã©ã¤ã¢ã³ãã«Playstation3ã使ã£ã¦ããã®ã§ãµã¼ãã¼ã½ããã«ã¯PS3 Media Serverã使ã£ã¦ããã®ã ããã©ãåããµã¼ãã¼ããiPhone4ã§åç»ãåçã§ããDLNAã¯ã©ã¤ã¢ã³ãããªãã¦å°ã£ã¦ããã
Media Link Playerã®接続確認済みデバイスリストã§ãPS3 Media Serverã§ã®åç»ã¯é対å¿ã®æ³¨éãã
1:PS3 Media Serverãç¹å®ã®éä¿¡æ¹å¼(keep-alive)ã«å¯¾å¿ãã¦ããªããããiOS4.2ã§ã¯PS3 Media Serverä¸ã®åç»ã¯åçã§ãã¾ããã
ããã¯è¨ããã¦ãKeep-aliveã«å¯¾å¿ãã¦ããªãããåçã§ããªãã¨ããã®ãè ã«è½ã¡ãªããKeep-aliveã¯å¤åHTTP Keep-aliveã®ãã¨ã ã¨æãããã³ã³ãã³ãã¯è¤æ°ã®ãã¡ã¤ã«ã«åããã¦ãã訳ã§ã¯ãªããã1åã®GETãªã¯ã¨ã¹ãã§ãã¡ã¤ã«ã¯æã«å ¥ãã¯ããä»®ã«ãã¡ã¤ã«ãµã¤ãºã大ããããè¤æ°ã®GETã«åããã¨ãã¦ãå½åº§ã®åçã«å¿ è¦ãªãã¼ã¿ã¯1åã®GETã§åå¾ããã°ããã¯ããKeep-aliveã®å¯å¦ã«ãããªã¼ãã¼ããããåé¡ã«ãªãã¨ã¯èãã¥ããããã以åã«PS3 Media ServerãHTTP Keep-aliveã«å¯¾å¿ãã¦ããªãã¨ãæããªãã
ã¨ãè¨ã訳ã§ã¯ã©ã¤ã¢ã³ãã®ä½ãæ¹æ¬¡ç¬¬ã§ä½ã¨ããªãããããªãã®ï¼ã¨ããæãããiPhoneç¨ã®PS3 Media Serveråãã¯ã©ã¤ã¢ã³ããèªä½ãã¦ã¿ããã¨æã£ãã
ã¾ãã¯ç®æ¨ã¨æ¡ä»¶ã以ä¸ã®ããã«è¨å®ããã
- ç®æ¨ï¼iPhone4ã§æ®å½±ããH.264åç»ãPS3 Media Serverã«é ç½®ãããããiPhoneä¸ããåçãã
- ãã¾ããªãã¨ããããç´æã¨ãããâ¦
- æ¡ä»¶1ï¼HTML + JavaScriptã§Webã¢ããªã¨ãã¦ä½æãã
- Appleã«ãå¸æ½ãæããããªãã®ã§Webã¢ããªã¨ãã¦éçºãããã¨ã«ãããåç»ã®ãã³ã¼ãã¾ã§èªåã§è¡ãããã¯ãªãã®ã§HTML5ã®Videoã¿ã°ãç¨ãã¦åçããããã«ããã
- æ¡ä»¶2ï¼å¯è½ãªéããµã¼ãã¼å´ã«ã¯æãå ¥ããªã
- ã¯ã©ã¤ã¢ã³ãã®ä½ãæ¹æ¬¡ç¬¬ã§ãã¨é¢¨åæ·ãåºããã®ã§ãµã¼ãã¼å´ã¯è¨å®å¤æ´ã§ãªãã¨ãã§ããããã«ããã
å®ã¯çµè«ããè¨ãã¨PS3 Media Serverå´ã«æãå ¥ããªãã¨åçã§ããªããã¨ãããããã½ã¼ã¹ã³ã¼ãã«æãå ¥ãã¦ãã«ããç´ããçµæMedia Link Player Liteã§åçãã§ãã¦ãã¾ã£ãããªã®ã§ã¯ã©ã¤ã³ããèªä½ãããã¨è¨ã試ã¿ã¯ç¡ç¨ã¨ãªã£ãã®ã§ä¸æ¢ããã
audioã¿ã°ãç¨ããMobile Safariä¸ã§ã®é³å£°ãã¡ã¤ã«åç
ã¾ãã¯PS3 Media Serverä¸ã«ãããªã¼ãã£ãªãã¡ã¤ã«ãhtmlä¸ããåçããã¦ã¿ã(ãããªããããªåçã¯åé¡ã®ããåããé£ãããããããªãã®ã§ã¾ãã¯ãªã¼ãã£ãªãã)ã
<html> <head> <meta charset="UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="apple-touch-icon" href="../images/icon-256.png"/> <title>Title</title> </head> <body> <audio controls="controls"> <source src="http://192.168.x.x:5001/get/0$0$0/xxxxxxxx.m4a"/> </audio> </body> </html>
PS3 Media Serverä¸ã«ãããã¦ããã³ã³ãã³ãå(audioã¿ã°ã®srcã«æå®ããã¨ããã)ã確å®ãããã«ã¯UPnPã®SOAPã¡ãã»ã¼ã¸ãããã¨ããã¦èª¿ã¹ãå¿ è¦ããã(å®éãããè¦å´ãããJavaScriptç¨ã®SOAPã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªã®æºåã¨ãã¯ãã¹ãã¡ã¤ã³åé¡ã®è§£æ±ºã¨ã)ã®ã ããã©ããã¯çç¥ã
ã¨ããããã®HTMLãMacã®SafariãChromeã§ã¯ãªã¼ãã£ãªã®åçãã§ããã®ã ããªããiPhoneä¸ã§ã¯ã¨ã©ã¼ã表示ããããããå°ã調ã¹ãã¨ããMP3ã¯åçã§ããã®ã ãAACã ã¨NGãåããããªHTMLãMacã®Apacheãã¡ã¤ã«å
±ææ©è½ã使ã£ã¦è¡¨ç¤ºãããã¨åé¡ãªãããã±ããã¢ãã©ã¤ã¶ã§ãã±ããã®å
容ã追ã£ã¦ã¿ãã¨ãªã¼ãã£ãªãã¡ã¤ã«ã«å¯¾ããGETã¯çºçãã¦ããããµã¼ãã¼å´ãä¸å¿ãã¼ã¿ã¯éã£ã¦ããããã ãã ã¨ããã¨ããã¯ã¬ã¹ãã³ã¹ãããã®åé¡ãï¼
ããã¾ã§ããã¨ãµã¼ãã¼ã§ãããã°ãã¦ã¿ãªãã¨ããããããªããPS3 Media Serverã®éè¯ãã«ããæ¤è¨ãããã¨ã«ããã
PS3 Media Serverã®ãã«ã
ãã«ãèªä½ã¯ã¨ã¦ãç°¡åãPS3 Media Serverã¯Javaã§å®è£ ããã¦ãã¦Eclipseã®ããã¸ã§ã¯ããã¡ã¤ã«ãç¨æããã¦ããã®ã§GoogleコードのSVNリポジトリããEclipseã®ããã¸ã§ã¯ãã¨ãã¦ç°¡åã«ã¤ã³ãã¼ããã§ããããããã°ããããã°ãã¿ã³ãæ¼ãã ãã§OKãLinuxçã«é¢ãã¦ã¯build.xmlãantå®è¡ããã ãã§é å¸ã¢ã¸ã¥ã¼ã«ã¾ã§ç°¡åã«ä½ãã親åãã
æ©éã¬ã¹ãã³ã¹ããããè¦ã¦ã¿ã
ãããã¬ä¸ã§ãªã¼ãã£ãªãã¡ã¤ã«ã®GETãªã¯ã¨ã¹ãã«å¯¾ããã¬ã¹ãã³ã¹ãè¦ã¦ã¿ããã¨ã
DefaultHttpResponse(chunked: false) HTTP/1.1 206 Partial Content Content-Type: audio/x-m4a Content-Range: bytes 0-1/16474173 Accept-Ranges: bytes Connection: keep-alive Server: Mac_OS_X-x86_64-10.6.8, UPnP/1.0, PMS/1.30.1 Content-Length: 16474173
æªããã¨æãã®ã¯2ã«æãContent-Typeã¨Content-Lengthã
- audio/x-m4aã¨ããMIME typeãSafariãèªèããªã
- Content-LengthãContent-Rangeã§æå®ããç¯å²ã®ãµã¤ãºã¨ç°ãªã
å¾è ã ã¨ããã¨MP3ã®å ´åã«åä½ããã®ã解ããªãã®ã§ã¾ãã¯åè ãçããMIME typeã¯è¨å®ãã¡ã¤ã«ã§ä¸æ¸ãã§ããã®ã§audio/mp4-latmã¨å¤æ´ãã¦ã¿ããå¹æãªããã§ã¯å¾è ãâ¦ããã¯ã½ã¼ã¹ã³ã¼ããç´ããããªãã
Index: net/pms/network/RequestV2.java =================================================================== --- net/pms/network/RequestV2.java (revision 748) +++ net/pms/network/RequestV2.java (working copy) @@ -522,7 +522,7 @@ } } else if (inputStream != null) { if (CLoverride > -1) { - if (lowRange > 0 && highRange > 0) { + if (lowRange >= 0 && highRange > 0) { output.setHeader(HttpHeaders.Names.CONTENT_LENGTH, "" + (highRange - lowRange + 1)); } else if (CLoverride != DLNAMediaInfo.TRANS_SIZE) { // since 2.50, it's wiser not to send an arbitrary Content length, @@ -574,7 +574,7 @@ // logger.trace( "Sending stream: " + sendB + " bytes of " + argument); // PMS.get().getFrame().setStatusLine(null); } else { - if (lowRange > 0 && highRange > 0) { + if (lowRange >= 0 && highRange > 0) { output.setHeader(HttpHeaders.Names.CONTENT_LENGTH, "" + (highRange - lowRange + 1)); } else { output.setHeader(HttpHeaders.Names.CONTENT_LENGTH, "0");
ã¨ãããã¨ã§Content-Rangeã§æå®ããç¯å²ã¨Content-Lengthã®å¤ãåãããã¨ããä»åº¦ã¯ãã¾ãè¡ã£ãã
åãããã«åç»ã®è¡¨ç¤ºããããã¨ããããããã¾ãè¡ãããããã¨æãML Playerã§åçããããã¨ããã¨ããã¾ã表示ã§ããããã«ãªã£ãï¼
ã¤ã¾ãã¯iOSã®HTTPã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªãContent-Rangeãããã¨Content-Lengthãããã®ä¸¡æ¹ãè¦ã¦ãã¦PS3 Media Serverããå±ãã¬ã¹ãã³ã¹ãä¸æ£ãªãã®ã¨èªèãã¦ããã®ãåå ã®ããã ãiOSã¬ãã«ã®ä»æ§ã«ãããã®ã ã¨ããã¨iOSã®DLNAã¯ã©ã¤ã¢ã³ãããã¨ãã¨ãåä½ããªãã®ãããªããããKeep-aliveäºã
ã¯é¢ä¿ãªãããã©ã¯ã©ã¤ã¢ã³ãå´ã§ã¯ã©ãã«ãã§ããªãã¨ããML Playerå´ã®è¨ãåã¯æ£ããã
ã¨ããããã§ãã®å¤æ´ã«ãã£ã¦ML Playerããã§ãPS3 Media Serverä¸ã®åç»ãè¦ãããããã«ãªã£ãã®ã§ã¯ã©ã¤ã¢ã³ãã®ä½æã¯ããã¦ãã¾ãã¾ãã(æ¬å½ã¯ML Playerã¯ãªã¼ãã£ãªåçä¸ãã¢ããªãåãæ¿ããã¨åæ¢ããã¨ãåç»ã®ã·ã¼ã³ãµã¼ããããã¥ããã¨ãä¸æºãããããã©ãã®ããã ãã«ã¯ã©ã¤ã¢ã³ããèªä½ããã»ã©ã®ã¢ããã¼ã·ã§ã³ã¯ãªãããï¼)ã
PlayStation 3 (160GB) ãã£ã³ã¼ã«ã»ãã©ã㯠(CECH-2500A)