1.uikitԴ?小虫象棋源码?
2.å¦ä½å¼åä¸ä¸ª AVPlayer iPad ç¨åº
uikitԴ??
硬件å端å¼åå硬件å端å¼ååªä¸ªå·¥èµé«åµå ¥å¼å¼åå硬件å端å¼åæ¯ä¸åäºåï¼ï¼?
åµå ¥å¼å¼åå硬件å软件å¼åï¼å ¶ä¸ç¡¬ä»¶å软件éé¢è¿è¦ç»åï¼å¾å¤å²ä½åé¢åã说å°åªä¸ªå·¥èµé«ï¼ä¸å¥½è¯´ï¼è¿åä¸åå°åï¼ä¸åå²ä½åä¸åæ°´å¹³æå ³ç³»ï¼æ以ä¸è½ä¸æ¦è论ã建议æ 论åå°åªä¸ªé¢åï¼å å¦å¥½å说ï¼ä¸è¦å¤ªå¨ä¹å·¥èµã
软件å¼åï¼å端å¼åï¼åå端å¼åï¼åªä¸ªæ´ç´¯ï¼åªä¸ªæ´æ£é±ï¼è°¢è°¢æç¹
é¦å ï¼è½¯ä»¶å¼åå ä¹å æ¬äºä¸åï¼ä¸ä» å æ¬å端å端è¿å æ¬åµå ¥å¼é½æ¯è½¯ä»¶å¼åã
å端å¼åè·å端å¼åï¼é½å¾ç´¯ï¼å ¨ç个人ã
å端ç®åæ´èµé±ï¼å 为å端æ£å¨èé£å ¶ä»æ¡é¢é¢åç份é¢ï¼å 为å端ç°å¨ä»»ä½çé¢é½å¯ä»¥è·ï¼LinuxãWinãMacãAndriodãiPhoneï¼ï¼è¿äºé¢åçä»·å¼æ£å¨è¢«è½¬ç§»å°å端ï¼ç¹æç½é¡µå端ï¼ï¼ä¹å°±æ¯è¯´ç®åå端æ¯è½åäºæ æå¤çï¼è³å°æ¯çä¸å»ã
å¾é«çº§ææ¯è®²ï¼å端ä¼æ¯å端è¦é¾ï¼ä¹è¦æ´ç´¯ï¼å·¥èµä¹æ´é«ã
æ以ï¼ç论ä¸ï¼å级ç¨åºåå端工èµé«ï¼é«çº§ç¨åºåå端工èµé«ã
ä½æ¯ï¼å®é ä¸ï¼å级æä¼åååï¼é«çº§ç¨åºåå¥é½è¦ã
å¦javaåºæ¥åï¼åå端è¿æ¯å端好ï¼ä»ææ¯æ¬èº«æ¥è¯´ï¼javaæ¬èº«ä¼ååå端ä¸äºï¼å¦æä½ å¯¹å端æå ´è¶£çè¯ï¼ånode.jsãbootstrapãvue.jsççå端æ¡æ¶çä¸èªå·±æ没æææ¡ï¼ç°å¨ä¸æ¯æç¹Html+cssæè è½åç¹ajaxå°±å¯ä»¥åå端äºãå½ç¶ï¼åå端çè¯ï¼é¤æ¤ä»¥å¤ï¼å¯¹ç½ç«çé è²ã页é¢çå¸å±ï¼å æ¬ä¸äºå®¡ç¾ççè¿æ¯æç¹å°è¦æ±çï¼å¦æä½ è½è¾¾å°çè¯ï¼ä½ å¯ä»¥å°è¯å»åå端ã
å°±ç®åæ¥è¯´ï¼éçåå端å离ï¼å端åå端çèªèµå¾ éè¿åå¿é½å·®ä¸å¤äºãéæ©å端è¿æ¯å端å¾å¤æ¶åç个人ææ¿å§ï¼æè æ¯è§å¾èªå·±å端强ç¹å¿è¿æ¯å端强ç¹å¿ï¼ä¸è¿ï¼ä»ä¸ªäººå»ºè®®ä¸æ¥è¯´è¿æ¯å端ä¼æ´å¥½äºï¼å 为å端ç¸å¯¹æ¥è¯´æ¯è¾ç®åï¼åäºä¸æ®µæ¶é´çå端è¿å¯ä»¥è½¬å»åå端ãå¦å¤çè¯ï¼å°±æ¯å¾å¤æ¶åå 个项ç®å¯ä»¥ç¨åä¸å¥å端æ¡æ¶ï¼éè¦çè¯æ¹æ¹å°±å¥½ï¼é¤é对å端è¦æ±è¾é«ï¼ä¸ä¸ªé¡¹ç®ä¸å¥å端ï¼ä¸è¬åè¿ç§æ åµè¿æ¯æ¯è¾å°çã
å¦ç¼ç¨è½åä»ä¹å·¥ä½ï¼çä½ å¦åªæ¹é¢çï¼å¦ç¼ç¨å¯ä»¥åå端å¼åï¼å端å¼åï¼åµå ¥å¼å¼åï¼è¿æè¿ç»´çå·¥ä½ï¼åå端è¦å¦htmlãcssãjsåpsï¼å端çè¯è¿è¦å¤å¦ä¸é¨å端è¯è¨javaãpythonçï¼è¿ç»´å¦linuxãshellçã
ç½é¡µè®¾è®¡å端åå端çåºå«ï¼è¶è¯¦ç»è¶å¥½ã详ç»ç解éä¸ä¸webåå端çåºå«
1ã
åå°ï¼åç°ç»ç¨æ·çè§è§ååºæ¬çæä½ã
åå°ï¼ç¨æ·æµè§ç½é¡µæ¶ï¼æ们çä¸è§çåå°æ°æ®è·å¨ãåå°å æ¬å端ãå端ã
å端ï¼å¯¹åºæ们åçhtmlãcssãjavascriptçç½é¡µè¯è¨ä½ç¨å¨å端ç½é¡µã
å端ï¼å¯¹åºjspãjavaBeanãdaoå±ãactionå±åserviceå±çä¸å¡é»è¾ä»£ç ãï¼å æ¬æ°æ®åºï¼
为ä»ä¹jspæ¯å端å¢ï¼ä¸»è¦æ¯jspçè¿è¡åçæ¯å¨tomcatæå¡å¨è¿è¡çã
2ã
(1)javawebæ¯javaå¼åä¸çä¸ä¸ªæ¹åjavaææå®åçï¼æwebçï¼æåµå ¥å¼ççãjavawebå°±æ¯ææwebæ¹åçï¼javawebå两åï¼ä¸åæ¯æå¡å¨ç«¯å«å端ï¼å¦ä¸åå«å端ï¼ä¹å°±æ¯webå端ãå端就æ¯ç¨æ·è½çå°çé¨åï¼æ¯å¦æ·å®ç½ï¼qq空é´ï¼ç½é¡µä¸ä½ è½çå°çé½æ¯webå端åçãå端åçå°±æ¯ä¸ºå端çå±ç¤ºä¸å¡é»è¾åè½åå¤çã
(2)javawebå æ¬äºjspï¼servelt以åä¸äºæ¡æ¶æ¯å¦springï¼structs以åä¸æ°æ®åºäº¤äºçç¥è¯ï¼å½ç¶ä¹æ¶åå°äºhtmlï¼cssçå端ææ¯ï¼ä½æ¯æ´ä¾§éäºå端çå¼åãwebå端主è¦æ¯htmlï¼cssï¼javascriptä¹ç±»çææ¯ã
jawebæ¯javaeeçä¸ä¸ªæ¹åï¼Javawebï¼ç±å端ãJava代ç ãåæ°æ®åºä¸ä¸ªå¤§æ¹é¢ç»æï¼å端åªæ¯å ¶ä¸ä¹ä¸ã
(3)å¨æ们çæºåä¸çå°ççé¢ï¼å®è£ çç¨åºï¼ç»ç¨æ·ççï¼æä½çå°±æ¯å端ï¼èä½ çä¸å°çï¼å¸®ä½ ä¿åç½ç»æ¸¸ææ°æ®ï¼ä¿ååºç¨æ°æ®ï¼å¤çæ°æ®çå°±æ¯å端ï¼æå¡å¨ï¼ãæ¯å¦è¯´ï¼æ们å¨ç¨çç¥ä¹å°±æ¯å端ï¼èä¿åè¿ä¸ªé®é¢ï¼è¿ææè¿ä¸ªé®é¢æ¨éç»ä½ çå°±æ¯å端ã
äºãå®ä¹ä¸å
ä¸è¬æ¥è¯´ï¼æ们å°ç½ç«å为å端åå端ãå端主è¦è´è´£é¡µé¢çå±ç¤ºï¼å端åæ¯ä¸å¡é»è¾çå®ç°ã
1ãWebå端:
顾åæä¹æ¯æ¥åWebçå端çãè¿éæ说çå端æ³æWebå端ï¼ä¹å°±æ¯å¨Webåºç¨ä¸ç¨æ·å¯ä»¥çå¾è§ç¢°å¾ççä¸è¥¿ãå æ¬Web页é¢çç»æãWebçå¤è§è§è§è¡¨ç°ä»¥åWebå±é¢ç交äºå®ç°ã
2ãWebå端ï¼
å端æ´å¤çæ¯ä¸æ°æ®åºè¿è¡äº¤äºä»¥å¤çç¸åºçä¸å¡é»è¾ãéè¦èèçæ¯å¦ä½å®ç°åè½ãæ°æ®çååãå¹³å°ç稳å®æ§ä¸æ§è½çã
ä¸ãéè¦ææ¡çææ¯ä¸å
1ãWebå端ï¼
ç²¾éJSï¼è½çç»åºç¨JQueryï¼æCSSï¼è½çç»è¿ç¨è¿äºç¥è¯ï¼è¿è¡äº¤äºææçå¼åã
(1)ç²¾éHTMLï¼è½å¤ä¹¦åè¯ä¹åçï¼ç»ææ¸ æ°ï¼æç»´æ¤çHTMLç»æï¼
(2)ç²¾éCSSï¼è½å¤è¿åè§è§è®¾è®¡ï¼å¹¶å ¼å®¹ä¸çæ¿è®¤ç主æµæµè§å¨ï¼
(3)çæJavaScriptï¼äºè§£ECMAScriptåºç¡å 容ï¼ææ¡1-2ç§jsæ¡æ¶ï¼å¦JQueryï¼
(4)对常è§çæµè§å¨å ¼å®¹é®é¢ææ¸ æ°çç解ï¼å¹¶æå¯é ç解å³æ¹æ¡ï¼
(5)对æ§è½æä¸å®çè¦æ±ï¼äºè§£yahooçæ§è½ä¼å建议ï¼å¹¶å¯ä»¥å¨é¡¹ç®ä¸ææå®æ½ã
2ãWebå端ï¼
å端å¼å人åï¼ä¼åJava代ç ï¼ä¼åSQLè¯å¥ï¼è½åç®åçæ°æ®åºè®¾è®¡ï¼ä¼SpringåiBatisï¼æä¸äºè®¾è®¡æ¨¡å¼çã
(1)ç²¾éjspï¼servletï¼javabeanï¼JMSï¼EJBï¼Jdbcï¼Flexå¼åï¼æè 对ç¸å ³çå·¥å ·ãç±»åºä»¥åæ¡æ¶é常çæï¼å¦Velocityï¼Springï¼Hibernateï¼iBatisï¼OSGIçï¼å¯¹Webå¼åç模å¼æè¾æ·±çç解ï¼
(2)ç»ä½¿ç¨oracleãsqlserverãmysqlç常ç¨çæ°æ®åºç³»ç»ï¼å¯¹æ°æ®åºæè¾å¼ºç设计è½åï¼
(3)çæmaven项ç®é 置管çå·¥å ·ï¼çætomcatãjbossçåºç¨æå¡å¨ï¼åæ¶å¯¹å¨é«å¹¶åå¤çæ åµä¸çè´è½½è°ä¼æç¸å ³ç»éªè ä¼å èèï¼
(4)ç²¾éé¢å对象åæå设计ææ¯ï¼å æ¬è®¾è®¡æ¨¡å¼ãUML建模çï¼
(5)çæç½ç»ç¼ç¨ï¼å ·æ设计åå¼å对å¤APIæ¥å£ç»éªåè½åï¼åæ¶å ·å¤è·¨å¹³å°çAPIè§è设计以åAPIé«æè°ç¨è®¾è®¡è½åã
åãwebå端åå端æ¯æä¹è¿æ¥çï¼
1ãwebæå¡å¨ï¼apacheãtomcatçï¼ï¼ç½ç»åè®®ï¼æè phpçé½å¯è½ï¼ä½javawebå¯ä»¥ç¡®å®å端就æ¯javaï¼webåç«¯å ¶å®é½ä¸æ ·ã
å端åJavawebçåºå«æ´å¤çå¨äºä¸ä¸ªä¸»è¦è´è´£å端ç设计åææï¼èJavawebæ´ä¸æ³¨äºå端çå 容ã
3ãåå¼å§ä»äºwebå¼åæ¶ï¼é¦å è¦éåå¦ä¹ æ¹åï¼çæ¯æ³ä»äºå端é¨åè¿æ¯å端ç¨åºé¨åãå½ç¶å¨å·¥ä½çåæï¼å°±ä¸ä¼åçé£ä¹ç»è´äºãåå端å°åæä¹ä¼æä¸äºå端çææ¯ï¼åä¹ï¼å端ä¹æ¯ã
å ãå¦ä¹ Webå端å¼åé½éè¦ææ¡åªäºæè½ï¼
1ãå¦ä¹ htmlãè¿ä¸ªæ¯æç®åç,ä¹æ¯æåºç¡ç.è¦çç»ææ¡divãformtableãulliãpãspanãfontè¿äºæ ç¾,è¿äºé½æ¯æ常ç¨ç,ç¹å«æ¯divåtable,divç¨äºå¸å±ãtableä¹å¯ä»¥ç¨äºå¸å±,ä½æ¯ä¸çµæ´»,åºæ¬tableæ¯ç¨æ¥åæ°æ®æ交éã
2ãå¦ä¹ cssãè¿é说çcssä¸å æ¬css3,ä¸è¬æ们çå°webå端å¼åå·¥ç¨å¸çè¦æ±éé¢,æä¸ä¸ªä¼ä½¿ç¨css+htmlæè css+divæ¥è¿è¡çé¢å¸å±,æ以cssæ¯ç¨äºè¾ å©htmlæ¥å¸å±åå±ç¤ºç,æ们称ä¹ä¸ºâcssæ ·å¼â,为ä»ä¹ä¼è¯´css+divå¢?å 为æä¸é¢è¯´äºdivå°±æ¯html主è¦ç¨äºå¸å±çä¸è¥¿,æ以divå°±æ¯æ ¸å¿ææ¡çä¸è¥¿!é£ä¹cssè¯å®å¿ é¡»è¦é ådivæ¥ä½¿ç¨æ好.cssè¦çç»ææ¡floatãpositionãwidthãheightï¼ä»¥å对äºçæ大æå°ãä¼ä½¿ç¨ç¾åç¾ãoverflowãmarginãpaddingçç,è¿äºé½æ¯è·å¸å±æå ³ç³»çæ ·å¼,ä¸ç¹è¦ææ¡ã
3ãå¦ä¹ jsãå¯è½å两个大家è§å¾è¿è¿çå»,çå°jså°±å»ç¼äº,å ¶å®å§,jså ¥é¨å¾ç®åç,ä¸éè¦ä¼å¾å¤ä¸è¥¿ç,åªè¦ä¼æ ¹æ®æ个idãæè nameæ¿å°ç½é¡µdomæè æ ·å¼ãæè å¼,ç¶åä¼ç»æ个idæè nameçå ç´ æ ç¾èµå¼ãæè 追å æ°æ®ã追html,è¿ä¸ªæ¯è·æ°æ®æå ³ç³»çæä½,ç¶åæ°æ®é»è¾å¤æ,æææ¹é¢ç,æ éå°±æ¯è·³è½¬ãå¼¹æ¡ãéèä»ä¹ç,æè¿äºå ¨é¨ç»åå ¶ä»å°±æ¯å®é ç¨éäº,代ç ä¸ç¹é½ä¸é¾,ä¼äºè¿äºåºç¡js,å ¶ä»çç´æ¥ç¾åº¦å°±å¥½äº.ç¶åçå¤äº,ç¨å¤äº,å°±ä»ä¹é½ä¸æ¯é®é¢äºã
4ãå¦ä¹ jqueryãjqueryæ¯ç¸å½äºæjså°è£ äºä¸å¥çä¸ä¸ªjsæ件,ç®çå°±æ¯æä½èµ·æ¥æ´æ¹ä¾¿,代ç åçæ´å°,jqueryå ¥é¨ä¹å¾ç®å,é£äºæ¯å ¥é¨éè¦å¦çåjsä¸æ ·,åªæ¯æ¢æäºjqç代ç .å ¶ä»çä¸æ ·ç¾åº¦å°±å¤äºã
5ãæ好ä¼ç¹åå°è¯è¨,æ¯å¦javaãphp,为ä»ä¹å¢?å 为åå°çé¢çæ°æ®é½æ¯ä»åå°æ¥ç,å¦æä¼ç¹åå°ä»£ç ,å°±ç¥éæä¹è·åå°äº¤äºæ°æ®æ¯æ好ç,è¿æ ·è约æ¶é´,ä¹å¯ä»¥è®©å端代ç æ´è§è.ä¸ç¶å¯è½å ä¸ºä½ çåæ³åå端ç»æ¥çæ°æ®ä¸è½ç»åä¸,é£ä¹å端代ç åå¾éæ°å,é£å°±æ´å 麻ç¦äºã
6ãå¦ä¹ css3+html5,å¯è½è¿ä¸ªå¯¹äºæ´æ¥æçæ°äººæ¥è¯´æç¹å°é¾ï¼éè¦è¾å¼ºç代ç ç¥è¯ä¸ç»éªï¼ä½æ¯å¦æä½ ä»¬æ¯åå¤ä¸é¨æå端,é£ä¹æ好è¿æ¯å¦ä¸ä¸ï¼è¿æ ·å¯¹äºå°æ¥çå·¥ä½ä¼ææ´å¤§ç帮å©ã
ä¸ãä»äºJavaå端å¼åé½éè¦ææ¡åªäºæè½ï¼
对äºåå¦Java并ä¸æå¿äºå端å¼åçåå¦æ¥è¯´ï¼éè¦éç¹å ³æ³¨ä»¥ä¸å 个é¨åï¼
1ãåºç¡ï¼æ¯å¦è®¡ç®æºç³»ç»ãç®æ³ãç¼è¯åççç
2ãWebå¼åï¼ä¸»è¦æ¯Webå¼åç¸å ³çå 容ï¼å æ¬HTML/CSS/jsï¼å端页é¢ï¼ãServlet/JSPï¼J2EEï¼ä»¥åMySQLï¼æ°æ®åºï¼ç¸å ³çç¥è¯ãå®ä»¬çå¦ä¹ 顺åºåºè¯¥æ¯ä»åå°åï¼å æ¤æå å¦ä¹ çåºè¯¥æ¯HTML/CSS/JSï¼å端页é¢ï¼ãè¿æä¸äºå段æ¡æ¶æ¯å¦easyui,è¿æjs,jqueryçææ¯ã
3ãJ2EEï¼ä½ éè¦å¦ä¹ çæ¯Servlet/JSPï¼J2EEï¼é¨åï¼è¿é¨åæ¯Javaå端å¼åå¿ é¡»é常精éçé¨åï¼å æ¤è¿é¨åæ¯è¿ä¸é¨åä¸æéè¦è±ç²¾åçãå ³äºServlet/Jspé¨åè§é¢çéæ©ï¼ä¸çæ¯è¾è®¤å¯é©¬å£«å µçè§é¢ã4ãæ°æ®åºï¼ä½ éè¦å¦ä¼ä½¿ç¨æ°æ®åºï¼mysqlæ¯ä¸ªä¸éçå ¥é¨éæ©ï¼èä¸Javaé¢åé主æµçå ³ç³»åæ°æ®åºå°±æ¯mysqlãè¿é¨åä¸è¬å¨ä½ å¦ä¹ Servlet/Jspçæ¶åï¼å°±ä¼æ¥è§¦å°çï¼å ¶ä¸çJDBCé¨åå°±æ¯æ°æ®åºç¸å ³çé¨åãä½ ä¸ä» è¦å¦ä¼ä½¿ç¨JDBCæä½æ°æ®åºï¼è¿è¦å¦ä¼ä½¿ç¨æ°æ®åºå®¢æ·ç«¯å·¥å ·ï¼æ¯å¦navicatï¼sqlyogï¼äºéä¸å³å¯ã
5ãå¼åæ¡æ¶ï¼ç®åæ¯è¾ä¸»æµçæ¯SSMæ¡æ¶ï¼å³springãspringmvcãmybatisãä½ éè¦å¦ä¼è¿ä¸ä¸ªæ¡æ¶çæ建ï¼å¹¶ç¨å®ä»¬ååºä¸ä¸ªç®åçå¢å æ¹æ¥çWeb项ç®ãä½ å¯ä»¥ä¸ç解é£äºé ç½®é½æ¯ä»ä¹å«ä¹ï¼ä»¥å为ä»ä¹è¦è¿ä¹åï¼è¿äºççåé¢ä½ å»äºè§£ãä½ä½ ä¸å®è¦å¯ä»¥å¿«éçå©ç¨å®ä»¬ä¸ä¸ªæ建åºä¸ä¸ªWebæ¡æ¶ï¼ä½ å¨æ建SSMçè¿ç¨ä¸ï¼å¯è½ä¼ç»å¸¸æ¥è§¦å°ä¸ä¸ªå«mavençå·¥å ·ãè¿ä¸ªå·¥å ·ä¹æ¯ä½ 以åå·¥ä½å½ä¸å ä¹æ¯å¿ é¡»è¦ä½¿ç¨çå·¥å ·ï¼æä»¥ä½ å¨æ建SSMçè¿ç¨ä¸ï¼ä¹å¯ä»¥é¡ºä¾¿äºè§£ä¸ä¸mavençç¥è¯ãå¨ä½ ç®åè¿ä¸ªé¶æ®µï¼ä½ åªéè¦å¨ç½ç»ä¸äºè§£ä¸ä¸mavenåºæ¬ç使ç¨æ¹æ³å³å¯ï¼ä¸äºé«ç«¯çç¨æ³éçä½ å·¥ä½ç»éªçå¢å ï¼ä¼éæ¸æ¥è§¦å°çã
6ãä½ éè¦å»çä¸äºJDKä¸çç±»çæºç ï¼ä¹å æ¬ä½ æ使ç¨çæ¡æ¶çæºç ãè¿äºæºç è½çæçåææ¯ï¼ä½ å¿ é¡»å¯¹è®¾è®¡æ¨¡å¼é常äºè§£ãå¦åçè¯ï¼ä½ çæºç çè¿ç¨ä¸ï¼æ°¸è¿ä¼æè¿æ ·é£æ ·ççé®ï¼è¿æ®µä»£ç 为ä»ä¹è¦è¿ä¹åï¼ä¸ºä»ä¹è¦å®ä¹è¿ä¸ªæ¥å£ï¼å®çèµ·æ¥å¥½åå¾å¤ä½ï¼ç±æ¤ä¹å¯ä»¥çåºï¼è¿äºå¦ä¹ çè¿ç¨æ¯ç¯ç¯ç¸æ£çï¼å¦æä½ ä»»ä½ä¸ä¸ªé¶æ®µæä¸æ¥äºï¼é£ä¹ä½ å°±ççè·ä¸ä¸äºï¼æè 说æ¯ä¸æ¥æ ¢æ¥æ¥æ ¢ãæ»èè¨ä¹ï¼è¿ä¸ªé¶æ®µï¼ä½ éè¦åçæ¯æ·±å ¥äºè§£Javaåºå±åJavaç±»åºï¼æ¯å¦å¹¶åé£æ¬ä¹¦å°±æ¯Java并åå java.concurrentçå 容ï¼ï¼ä¹å°±æ¯JVMåJDKçç¸å ³å 容ãèä¸è¿è¦æ´æ·±å ¥çå»äºè§£ä½ æ使ç¨çæ¡æ¶ï¼æ¹å¼æ¯è¾æ¨èçæºç æè çå®æ¹ææ¡£ã
å¸æ对æ¨ææ帮å©ï¼~
å¹´ï¼å端ï¼ç§»å¨å¼åï¼å端ï¼æ该éåªä¸ªï¼è¯·å ç»åºæç¡®çå¤ï¼æ¨èéå端å¼åï¼webå端å¯ä»¥è¯´åéä¸å¯ééï¼
解éåå ï¼
ç°å¨çWebå端ææ¯å¯ä»¥è¯´æ¯è¶æ¥è¶æçäºï¼Webå端å¸åºä¹é常çç«çï¼Webå端人æä¹æ¯å¼å¸¸ç紧缺ãåè ï¼ç±äºäºèç½çå´èµ·ï¼Webå端ææ¯çä¸æåå±ï¼ä¹å æ®äºäºèç½çä¸å¸ä¹å°ã
é£ä¸ºä»ä¹è¯´Webå端æ å¯ééå¢ï¼å½å¤èåçèªåªä½å¹³å°facebookï¼ç¸ä¿¡å¤§å®¶å¤å¤å°å°ç¥éä¸ç¹ï¼ä¹ç¨è¿ä¸ç¹ï¼å®å°±æ¯Webå端ææ¯ç产ç©ï¼å®å ¨åºäºå端æ¡æ¶æé åºæ¥çå¹³å°ãåè ï¼å¤§å®¶å¸¸ç¨çå¤åå¹³å°é¥¿äºä¹ï¼å®æä¸çé¨å产åå°±æ¯åºäºWebå端ææ¯çãåæ·å®ï¼ç¾åº¦ï¼é¿éççï¼é½å·²ç»å°Webå端ææ¯æå ¥å°äºèªå·±ç产åä¸ã
å端å¼åè¡ä¸èªèµæ°´å¹³åä¸æ¶¨è¶å¿ï¼Webå端å¼åæ©å·²ä¸æ¯å带å¨ç»çä¸æèåçæ¶ä»£äºï¼ä»ä»¬å·²æ为äºèç½ä¸»å®°è ï¼åè¡ä¸é½ç¨å ¶å¼åäºèç½åºç¨ãä½ç®åæ´äºèç½è¡ä¸çWebå端å¼åå·¥ç¨å¸ç´§ä¿ï¼ä¼ä¸æ£é«èªæ±æï¼èªèµå¾ éä¸æ¶¨å涨ï¼
Webå端ææ¯å¯ä»¥è¯´æ¯è¶æ¥è¶æçäºï¼Webå端å¸åºä¹é常çç«çï¼Webå端人æä¹æ¯å¼å¸¸ç紧缺ãåè ï¼Webå端è¡ä¸ä¹æ¯æ å¯ééãç±äºäºèç½çå´èµ·ï¼Webå端ææ¯çä¸æåå±ï¼ä¹å æ®äºäºèç½çä¸å¸ä¹å°ã
Webå端å¼åå·¥ç¨å¸å·²ç»æ为åå±ä¸çèä¸é¦é¦é¦ãå ä¹æ´ä¸ªäºèç½è¡ä¸é½ç¼ºWebå端工ç¨å¸ï¼æ 论æ¯åèµ·æ¥çåä¸å ¬å¸ï¼è¿æ¯ä¸å¸å ¬å¸ä¹è³å·¨å¤´ï¼ç©ºç¼ºä¸æ ·åå¨ãä¼ç§çWebå端工ç¨å¸ç®ç´æ¯å¤§çç«è¿ç¨å°ã
ææ 解å³åæ³ï¼æ以ï¼è¿æ¯å¾æ¨èä½ å¦ä¹ webå端çï¼å¦æççæ³å¦ä¹ ï¼å¯ä»¥äºè§£ä¸ä¸å京å°å¦å ï¼æ们æ¯ä¸é¨åç¼ç¨å¹è®çï¼æ¥ææå ¶ä¸°åçå¸èµåéï¼å¸¦ç»ä½ ä¸ä¸æ ·çå¦ä¹ ä½éªãå享ä¸ä¸å端çç¥è¯æ¡æ¶ï¼å¸æå¯¹ä½ ææ帮å©ï¼
å¦ä½å¼åä¸ä¸ª AVPlayer iPad ç¨åº
AirPlay 并ä¸æ¯æ°ä¸è¥¿ï¼å®å¨ iOS 4.3 SDK ä¸å°±åå¨äºãä½AirPlay API ä¸ä¸æææ°çä¸è¥¿å å ¥ãå ¶ä¸ä¸ä¸ªæ趣æ°ç¹æ§æ¯ iPad ç¨åºè½éè¿ Apple TV 2 ææ¾æ¥èª iOS 设å¤ä¸çå 容ï¼æè éåiPad 2 ä¸çå±å¹å 容ã
ç®èè¨ä¹ï¼AirPlay å°±æ¯å°åªä½å 容ææ¾å°é«æ¸ æ¾ç¤ºå¨ï¼çµè§ï¼æé«æ¸ é³æç³»ç»ä¸ãApple TV 2 åæ¯ç¨äºè¿æ¥ iOS 设å¤æ iTunesä¸é«æ¸ 设å¤ä¹é´çæ¡¥æ¢ã
éç iOS 5 çåºç°ï¼ä»»ä½ä½¿ç¨ AV Foundation ç±»çç¨åºé½è½ä»ç¨åºä¸ææ¾é³è§é¢å å®¹å° Apple TVãä½ å¯ä»¥ç¨MPMoviewPlayerController éè¿ AirPlay å°å½åæ£å¨ææ¾çå 容æå½±å°é«æ¸ çµè§æå ¶å®é«æ¸ æ¾ç¤ºè®¾å¤ä¸ãå¦ä¸ä¸ªè¿æ¥æ¯ä»UIWebView ææ¾è§é¢ï¼è¿æ¯æ¿å¨äººå¿çæ¹è¿ï¼å 为è¿æå³çæ们å¯ä»¥ç´æ¥ä» web ä¸å°å¨çº¿çé³è§é¢æå½±å°çµè§æè Apple TV 2 ä¸ã
ä½¿ç¨ AVFoundation æå½±è§é¢å 容
è¦å¨åºç¨ç¨åºä¸ä½¿ç¨ AVFoundationï¼éè¦å®ç° AVPlayer 并设置 allowsAirPlayVideo 为 YES 以å¼å¯ AirPlayï¼æè 设置为NO ä»¥å ³é AirPlayï¼å¦ä»¥ä¸ä»£ç æ示ï¼
-(BOOL)setAirPlay:(BOOL)airplayMode{
return self.player.allowsAirPlayVideo=airplayMode;
}
ç¼ååºç¨ç¨åº
为äºæ¼ç¤ºå¦ä½å建 AVPlayer åºç¨ç¨åºä»¥åå®ç° AirPlayï¼æ们å°å建ä¸ä¸ª Single View Application(注æå¾é UseStoryboards)ï¼æ°å»ºä¸ä¸ª AVPlayer 类并å®ç° AirPlay ç¹æ§ã
å建ä¸ä¸ª Single View Applicationãç®æ ç±»åå¯ä»¥éæ© iPhoneãiPod æè iPadãå建项ç®ä¹åï¼åå¯¼å ¥ AV Foundation æ¡æ¶ã
æ¥çå建ä¸ä¸ªæ° classï¼å½å为 Playerï¼å¹¶ç»§æ¿ UIView ç±»ãå¨å¤´æ件ä¸ï¼å å ¥ AVPlayer 类并å¢å ä¸ä¸ª AVPlayer å±æ§ãå¦ä¸å代ç æ示ã
@class AVPlayer;
@interface Player : UIView
@property(nonatomic, strong) AVPlayer * player;
æ¥ä¸æ¥å°±æ¯å®ç° Player ç±»ã
æ们å®ç°äºæåºæ¬ç AVPlayer éè¦å®ç°çæèµ·ç ç 4 个æ¹æ³ï¼åæ¶è¿æä¾äºä¸ä¸ªæ¹æ³ä½ä¸ºæ们ç AirPlay å¼å ³ã
é¦å æ们éè¦ä¸ä¸ª AVLayer ç±»çå è£ ç±»ã该类æ¯ä¸ä¸ª CALayer åç±»ï¼ç¨äºå¯¹åªä½çå¯è§å 容è¿è¡ç®¡çãå建å è£ ç±»ç代ç å¦ä¸ï¼
+ (Class)layerClass {
return [AVPlayerLayer class];
}
ç¶å为éè¦ä¸ä¸ªæ¹æ³ï¼å®ä¾åä¸ä¸ª AVPlayer 对象ï¼æ们å¨å¤´æ件ä¸å®ä¹çï¼ãå¦ä¸å代ç æ示ã
-(AVPlayer *) player{
return [(AVPlayerLayer *)[self layer] player];
}
å¨ setPlayer æ¹æ³ä¸ï¼å¦ä¸å代ç æ示ï¼æä¸ä¸ª AVPlayer åæ°ï¼ç¨äºå°ä¸ä¸ª AVPlayer å®ä¾æ·»å å° UIViewãè¿ä¸ª UIView åç±»ï¼å°ç¨å¨ä¸» View Controller ä¸ã
- (void)setPlayer:(AVPlayer*)player {
[(AVPlayerLayer*)[self layer] setPlayer:player];
}
è¿ä¸ªç±»çæåä¸ä¸ªæ¹æ³æ¯ setAirPlay æ¹æ³ãå ¶åæ°å°ç¨äºæå® AVPlayer UIView (Player)çallowsAirPlayVideo å±æ§ãå¦ä»¥ä¸ä»£ç æ示ã
-(BOOL)setAirPlay:(BOOL)airplayMode{
return self.player.allowsAirPlayVideo=airplayMode;
}
为è§é¢çè¾åºæå®å¾å±(AVPLayerLayerï¼æ¶ï¼å¯ä»¥æå®ä»»ææ°éçå¾å±,åªè¦è½æ¹ä¾¿æ§å¶å 容æ¾ç¤ºãæ¯å¦è¯´å¤çé³é¢åè§é¢ä¹é´çæ¶é´åæ¥ãéè¿setDisplayModeï¼ä½ å¯ä»¥è®¾ç½®ç¨äºæ¾ç¤ºçå¾å±ï¼å å建ä¸ä¸ª AVPlayerLayer 对象ä½ä¸ºæ¾ç¤ºå¾å±ï¼ç¶åä¿®æ¹å®çå±æ§ãé»è®¤æ¯AVLayerVideoGravityResizeAspect å±æ§ï¼å¦å¤ä¹å¯ä»¥è®¾ç½® AVLayerVideoGravityResizeAspectFill å±æ§åAVLayerVideoGravityResize å±æ§ã AVLayerVideoGravityResizeAspect ä¿æè§é¢ç宽é«æ¯å¹¶ä½¿ææ¾å 容èªå¨éåºææ¾çªå£ç大å°ãAVLayerVideoGravityResizeAspectFill ååè 类似ï¼ä½å®æ¯ä»¥ææ¾å 容填å èä¸æ¯éåºææ¾çªå£ç大å°ãæåä¸ä¸ªå¼ä¼æ伸ææ¾å 容以éåºææ¾çªå£ã
Player ç±»çå®æ´ä»£ç å¦ä¸ï¼
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
@class AVPlayer;
@interface Player : UIView
@property(nonatomic, strong) AVPlayer * player;
-(BOOL) setAirPlay:(BOOL) airplayMode;
@end
#import "Player.h"
#import <AVFoundation/AVFoundation.h>
@implementation Player
+ (Class)layerClass {
return [AVPlayerLayer class];
}
-(AVPlayer *) player{
return [(AVPlayerLayer *)[self layer] player];
}
- (void)setPlayer:(AVPlayer*)player {
[(AVPlayerLayer*)[self layer] setPlayer:player];
}
//Enable or disable AirPlay mode
-(BOOL)setAirPlay:(BOOL)airplayMode{
return self.player.allowsAirPlayVideo=airplayMode;
}
@end
å¨ç¨åºä¸ä½¿ç¨ Player ï¼UIViewåç±»ï¼
ä¸è¿°ä»£ç å æ¬äºPlayer ï¼AVPlayer ç UIView åç±»ï¼ç.hæ件å.m æ件ã
è¦å¨ä¸ä¸ª UIViewController ä¸ä½¿ç¨è¿ä¸ª AVPlayer è§å¾ï¼æå¼ Xcode çæ äºæ¿(storyboard,åææ¯å建项ç®æ¶ä½¿ç¨äºâuseStoryboardâé项ï¼ãéä¸UIView(ä¸æ¯ UIViewControllerï¼å¹¶å°å®ç类修æ¹ä¸º Playerãä½ å¯ä»¥å¨ Identity é¢æ¿ç customeclass å段è¾å ¥ï¼ä¹å¯ä»¥ä»å®çä¸æå表ä¸éæ©ã
æå¼ Assistant Editor ,为 UIView åç±» Player å建ä¸ä¸ª IBOutlet,ä» view ç¨å³é®æå°å³è¾¹ç头æ件ä¸å³å¯ãå¦ä¸å¾æ示ã
å建IBActions å IBOutlets è¿æ¥
å建ä¸ä¸ªå§æå° klViewController ãå¨ Player ä¸å³é®ï¼ä» IBOutlet æä¸ä¸ªè¿æ¥çº¿å° klViewController (dock ä¸çé»è²æ¹å) ï¼å¦ä¸å¾æ示ã
æ·»å å§æè¿æ¥ klViewController
å¨æ äºçä¸ï¼å ä¸ä¸ª Toolbar ãå¨ Toolbar æ¯å å ¥ä¸¤ä¸ªæé®ï¼åå«å°æ ç¾ææ¬è®¾ç½®ä¸º Play å Pauseãç¶åå ä¸ä¸ª Switchï¼ç¨äºåæ¢AirPlay å¼å ³ç¶æãä¸ºè¿ 3 个æ§ä»¶å建ç¸åºç IBActionï¼å¯ä»¥ç¨ Assistant Editorï¼ãå©ä¸çäºæ å¨ klViewController ç±»ä¸è¿è¡ã
æå¼ klViewController.h æ件ï¼å å ¥ @class Player å @class AVPlayer è¯å¥å¹¶å¯¼å ¥ AVFoundation æ¡æ¶å Player.hãæºä»£ç è§ä¸ï¼
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import "Player.h"
@class Player;
@class AVPlayer;
@interface klViewController : UIViewController
声æä¸ä¸ª AVPlayer å±æ§ï¼ç¨äºå è½½å° Palyer è§å¾ä¸ã
声æä¸ä¸ª NSURL å±æ§ãç¶åæ¯ Switch æ§ä»¶ç IBOutletï¼ç¨ Assistant Editorå建ï¼ã
kvLiewController.h æ件代ç å¦ä¸ï¼
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import Player.h
@class Player;
@class AVPlayer;
@interface klViewController : UIViewController
@property(nonatomic, strong) AVPlayer * myPlayer;
@property(nonatomic, strong) NSURL * avContentUrl;
@property (strong, nonatomic) IBOutlet Player *airPlayView;
@property (nonatomic, retain) IBOutlet UISwitch * AirPlaySwitch;
- (IBAction)PlayVideo:(id)sender;
- (IBAction)PauseVideo:(id)sender;
- (IBAction)isAirPlayOn:(id)sender;
@end
æ¥ä¸æ¥æ¯ç±»çå®ç°æ件ãå¨ viewDidLoad æ¹æ³ä¸ï¼ç¨ä¸ä¸ªè§é¢æ件ç URL å°ååå§å avContentUrlï¼
avContentUrl = [[NSURL alloc] initWithString
ç¶åç¨ avContentUrl åå§åä¸ä¸ª AVPlayer ï¼ç¨äºç»å¤´æ件ä¸å®ä¹ç myPlayer å±æ§èµå¼ãå° myPlayer èµç» airPlayView ç player å±æ§ï¼airPlayerView æ¯ä¸ä¸ª Player 对象ãå¦ä¸å代ç æ示ï¼
self.myPlayer = [AVPlayer playerWithURL:avContentUrl];
[airPlayView setPlayer:[self myPlayer]];
ç°å¨ï¼è¦å®ç°ä¸¤ä¸ªæé®çè§é¢ææ¾åæååè½ï¼ä»¥å Switch æ§ä»¶ç AirPlay å¼å ³åè½ãææ¾æé®ç action æ¹æ³ä»£ç å¦ä¸æ示ï¼
- (IBAction)PlayVideo:(id)sender {
[self.myPlayer play];
}
æåæé®ç action æ¹æ³ä»£ç å¦ä¸æ示ï¼
- (IBAction)PauseVideo:(id)sender {
[self.myPlayer pause];
}
Switch æ§ä»¶ç action æ¹æ³ä»£ç å¦ä¸æ示ï¼
- (IBAction)isAirPlayOn:(id)sender {
AirPlaySwitch = (UISwitch *) sender;
if (AirPlaySwitch.on) {
[airPlayView setAirPlay:NO];
}else
{
[airPlayView setAirPlay:YES];
}
}
ç»å°¾
å¦ä¸ä¸ªä¸ AirPlay æå ³çå±æ§æ¯ usesAirPlayVideoWhileAirPlayScreenIsActive ï¼å®ç¨äºèªå¨å¨å¨ææ¾æé´å° AVPlayer åæ¢å° AirPlay,å½ç¶ä» ä» æ¯å¨ AirPlay å·²å¼å¯çæ åµä¸ãé»è®¤æ¯ false çã
è¦è¿è¡æ¬ç¤ºä¾ç¨åºï¼éè¦å¨ iPad ä¸è¿è¡ï¼å¹¶å° iPad è¿æ¥è³ Apple TV åä¸ wifi ç½ç»ï¼ç¶åè§é¢èµæºç URL å¿ é¡»æ¯ææçãå¨æ¨¡æå¨ä¸AirPlay æ¯æ æçã
klViewController.h æ件
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import "Player.h"
@class Player;
@class AVPlayer;
@interface klViewController : UIViewController
@property(nonatomic, strong) AVPlayer * myPlayer;
@property(nonatomic, strong) NSURL * avContentUrl;
@property (strong, nonatomic) IBOutlet Player *airPlayView;
@property (nonatomic, retain) IBOutlet UISwitch * AirPlaySwitch;
- (IBAction)PlayVideo:(id)sender;
- (IBAction)PauseVideo:(id)sender;
- (IBAction)isAirPlayOn:(id)sender;
@end
klViewController.m æ件
#import "klViewController.h"
@implementation klViewController
@synthesize airPlayView;
@synthesize avContentUrl, myPlayer, AirPlaySwitch;
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
//This is an Apple sample video
avContentUrl = [[NSURL alloc] initWithString:@" self.myPlayer = [AVPlayer playerWithURL:avContentUrl];
[airPlayView setPlayer:[self myPlayer]];
[self.myPlayer play];
}
- (void)viewDidUnload
{
[self setAirPlayView:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
}
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (IBAction)PlayVideo:(id)sender {
[self.myPlayer play];
}
- (IBAction)PauseVideo:(id)sender {
[self.myPlayer pause];
}
- (IBAction)isAirPlayOn:(id)sender {
AirPlaySwitch = (UISwitch *) sender;
if (AirPlaySwitch.on) {
[airPlayView setAirPlay:NO];
}else
{
[airPlayView setAirPlay:YES];
}
}
@end