Under Apple's iOS, there is an app air video that allows you to directly play the video on your PC remotely via WiFi, without having to copy the video to your phone. Very useful! Recently used Android mobile phone, looking for similar applications, looking for a long time to find. Think carefully about the work of the Airvideo, and Youku and other video sites similar to the Android should also have a similar method to achieve.
Today in the Huawei Glory 6 above finally verified the adoption of a perfect solution, hurriedly put up and have the same needs of friends to share.
Let's talk about how Air video works:
1) Install the Air video server servers under Windows and set the video files directory to allow remote viewing
2) Download the Airvideo client via Apple's AppStore and install
Air Video Apple client is charged, it seems not cheap, of course, there is no such a problem after the jailbreak
3) The Air video client connects to the server side of Windows and can see a list of video files for each directory on the server and select Play. which
MP4 can be played directly, rmvb\flv and so on need the service side real-time conversion to MP4 video stream, and then to the client on iOS
Note: Real-time conversion, look at the CPU consumption of Windows system is actually very high, very environmentally friendly
Apple inside the Airvideo client plays the video player, looks and plays Youku and other video site players directly, it looks like it is actually the same. It is doubtful that the airvideo is sent to the client's MP4 video stream, and the MP4 video stream under the Web environment may be the same, all accessed via an HTTP address. Of course, this statement is only speculation, all without basis. Based on this idea, a Web service that provides video streaming through the web address on your phone can be viewed on your phone.
The concrete steps come, toss a few days, oneself also didn't think the result can be so simple :
A) Download tomcat from the Internet and install it, I downloaded the green version of TOMCAT5.5 from this address, if there is already tomcat, you can skip this step
Http://www.rsdown.cn/down/32748.html
A) After the download can be thin, delete the contents of these directories, the entire directory only about 5Mb (directory cannot be deleted)
webapps/
server/webapps/
conf/catalina/localhost/
b) If Tomcat is already installed, there are already catalina_home environment variables, and now you need to re-download one:
-Use text to edit Bin/startup.bat files
-Add REM in front of line 11 and comment out the line, otherwise the system's catalina_home environment variable will still be used
REM if not "%catalina_home%" = = "" Goto gothome
c) to the Conf directory, use the simplest server configuration file
-Rename Server.xml to Server-normal.xml
-Rename Server-minimal.xml to Server.xml
II) Tomcat default does not support the URL contains Chinese, which will cause the file name in Chinese video can not play, method:
Using text editing Server.xml, set connector uriencoding to Utf-8, such as:
<connector port= "8080" uriencoding= "Utf-8"/>
Reference Address: http://www.williamlong.info/archives/469.html
III) Set the contents of the video file directory and allow publishing via Tomcatweb. Method:
Using text editing Server.xml, set host and context, my modifications are as follows
<context path= "/" docbase= "." debug= "0"/>
<context path= "/fd" docbase= "C:\FDOWNLOAD\" debug= "0"/>
</Host>
In this way, the video files of the C:\TDDOWNLOAD\ directory can be accessed through the http://localhost:8080/address;
Access the video files of the C:\FDOWNLOAD\ directory through the http://localhost:8080/fd/address;
Four) enable Tomcat to support a direct web browser to view a list of files below the directory, and see the following effects:
Configuration method:
Use text to edit Conf/web.xml, find listings, and set the parameter to True.
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
V) Install the UC browser on your Android phone. Believe that a lot of people have used UC, this does not elaborate on the steps.
Note: On the same phone tried UC and chrome, found that chrome can only download rmvb/flv, not play, but UC can, therefore, require UC
VI) At this point, execute Tomcat in the bin directory Startup.bat boot Tomcat and connect the phone and computer to the same network;
Next, the use of UC should already be able to view Tomcat published Web pages, UC address such as: Http://192.168.1.123:8080/,IP address is the address of the computer Tomcat
Try clicking on the *. MP4 file, the following prompt appears. Select [Play online], haha, MP4 can be seen directly on the phone
VII) The revolution has not been successful, try the rmvb/flv file, found still can not see. Back to the Tomcat configuration file
Use a text editor to open Bin/web.xml, and under MP4 settings, increase the MIME type of RMVB and FLV.
<mime-mapping>
<extension>mp4</extension>
<mime-type>video/mp4</mime-type>
</mime-mapping>
<mime-mapping>
<extension>rmvb</extension>
<mime-type>video/x-rmvb</mime-type>
</mime-mapping>
<mime-mapping>
<extension>flv</extension>
<mime-type>video/x-flv</mime-type>
</mime-mapping>
Next, restart Tomcat and try clicking * in the UC again. RMVB and *. FLV files, if all can play, indicate your luck. If still not, I am sorry, I can only do this. I use a cool 8150s low-end mobile phone test, also can not see rmvb/flv video, but Glory 6 is very normal. This may be related to the Android OS version, or the manufacturer's customization.
Other additions:
1) Chrome under Windows can only support playing MP4, if the browser does not support, but still very much want to see rmvb/flv on the phone, you can trouble point, first use the format factory on the computer to convert to MP4 format
2) Air video, the format factory uses FFmpeg, Mp4creator and other open source projects to convert MP4 video streams, and is called through the command line. The mobile phone control computer conversion format for MP4, should be able to further study, but not professional is too waste of time
3) also tried to use JSP files to do video file display, Android needs HTML5 is very simple, but looks like the results of the previous configuration and no difference. HTML5 Web embed video code examples are as follows
<divid= "video" style= "Position:relative;z-index:100;width:100%;float:left;" >
<video id= "Media" width= "100%" autoplay= "AutoPlay" controls>
<source src= "<%=path +file%>" >
</video>
</div>
The results of the preliminary analysis, video Web page in order to support in IE, Chrome, Android, iOS play video, need to base on the HTTP request message header browser type judgment, embedded different video playback code, and even provide a different video file format. iOS really only supports MP4 playback, other formats are not supported ....