Android [Android] edition Air Video remote playback of computer videos

Source: Internet
Author: User
Tags flv file

Android [Android] edition Air Video remote playback of computer videos


In Apple's iOS, there is an application of Air Video, which can remotely play videos in the computer on iOS through Wifi without copying the Video to the mobile phone. Very easy to use! I recently used my Android mobile phone and tried to find a similar app. I haven't found it for a long time. After carefully thinking about how AirVideo works, it is similar to Youku and other video websites. Similar methods can be implemented in Android.

Today, we finally passed a perfect solution on honor 6 and shared it with friends in the same need.

Let's talk about how Air Video works:

1) install the Air Video Server in Windows and set the directory of the Video files that can be viewed remotely.

2) download the AirVideo client from Apple's AppStore and install

The Air Video Apple client charges fees and does not seem cheap. Of course, this problem will not exist after jailbreak.

3) The Air Video client connects to the Windows server. You can view the list of Video files in various directories on the server and select play. Where:

MP4 can be played directly. RMVB \ FLV and other video streams that need to be converted from the server to MP4 in real time are then transmitted to the client on iOS.

Note: Real-time conversion. It seems that the CPU usage in Windows is still quite high, which is very environmentally friendly.


The AirVideo client playing a video player in Apple looks the same as playing a player on a video website such as Youku directly. Therefore, it is suspected that the MP4 video stream that AirVideo sends to the client may be the same as the MP4 video stream in the WEB environment and is accessed through the HTTP address. Of course, this is just speculation and there is no basis. Based on this idea, you only need to build a WEB service to provide video streams on your mobile phone through the WEB address. Then, you can watch videos on your computer on your mobile phone.

The specific steps have come. After a few days, I did not expect the results to be so simple:

1) download and install TOMCAT from the internet. I downloaded the green version of TOMCAT 5.5 from this address. If TOMCAT already exists, skip this step.

Http://www.rsdown.cn/down/32748.html

A) after downloading, you can reduce the size of the directories. After deleting the contents under these directories, the entire directory is only about 5 MB (the directory cannot be deleted)

Webapps/

Server/webapps/

Conf/Catalina/localhost/

B) If you have installed tomcat and the CATALINA_HOME environment variable already exists, you need:

-Use text to edit the bin/startup. bat file

-Add REM to line 11 to comment out the content of the line. Otherwise, the system will still use the CATALINA_HOME environment variable.

REM if not "% CATALINA_HOME %" = "" goto gotHome

C) use the simplest server configuration file in the conf directory.

-Rename server. xml as a server-normal.xml

-Rename the server-minimal.xml to server. xml

(2) TOMCAT does not support Chinese Characters in URLs by default. This will cause video files with Chinese characters to be unable to be played. Method:

Use the text editor server. xml to set the URIEncoding of Connector to UTF-8, for example:


Reference: http://www.williamlong.info/archives/469.html

3) set the video file directory and allow publishing through TOMCATWEB. Method:

Use text to edit server. xml and set Host and Context. After my modifications




In this way, you can access the video files in the C: \ TDDOWNLOAD \ directory through http: // localhost: 8080/address;

Access the video file in the C: \ FDOWNLOAD \ directory through http: // localhost: 8080/fd/address;

4) Make TOMCAT support viewing the list of files under the directory in a WEB browser. The effect is as follows:


Configuration method:

Use text to edit conf/web. xml, search for listings, and set the parameter to true.


Listings

True


5) install the UC browser on your Android phone. I believe many people have already used UC, so I will not elaborate on the steps.

Note: I tried UC and Chrome on the same mobile phone and found that Chrome can only download RMVB/FLV, but cannot play, but UC can. Therefore, UC is required.

6) execute startup. bat in the bin directory to start TOMCAT and connect the mobile phone and computer to the same network;
Next, you can view the web page published by TOMCAT by using UC. The UC address is http: // 192.168.1.123: 8080/, and the IP address is the address of the computer where TOMCAT is located.
Click *. MP4 to display the following prompt. Select[Online playback]Haha, MP4 can be viewed directly on the mobile phone.


7) the revolution has not yet succeeded. Try the RMVB/FLV file and find that it is still unreadable. Return to the TOMCAT configuration file.

Open bin/web. xml in the text editor and add the mime types rmvb and flv under the mp4 settings.


Mp4

Video/mp4



Rmvb

Video/x-rmvb



Flv

Video/x-flv



Next, restart TOMCAT and click *. RMVB and *. FLV files in UC again. If both files can be played, you are lucky. If it still doesn't work, I'm sorry. I can only do this. I am using a low-end mobile phone test of coolpad 8150s, and I cannot watch RMVB/FLV videos, but honor 6 is quite normal. This may be related to the Android operating system version or vendor customization.

Other supplements:

1) Chrome in Windows only supports playing MP4 videos. If the browser does not support playing MP4 videos, but you still want to watch RMVB/FLV on your mobile phone, you can try it, convert the format factory to MP4 format on the computer first

2) Air Video and format factories use ffmpeg, mp4creator, and other open-source projects to convert MP4 Video streams and call them through command lines. Using a mobile phone to control the computer to convert the format to MP4 should be able to further research, but it is a waste of time if it is not professional.

3) I also tried to use jsp files to display video files. HTML5 required by Android is very simple, but it seems that the effect is no different from the previously configured results. An example of HTML 5 video embedding code is as follows:







As a result of preliminary analysis, to support video playback in IE, Chrome, Android, and iOS at the same time, different video playback codes must be embedded based on the browser type of the HTTP request message header, different video file formats are even provided. IOS can only play MP4 videos, but not in other formats ....



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.