Android webview: video playback, androidwebview

Source: Internet
Author: User

Android webview: video playback, androidwebview

My App has video teaching, but our company is a small startup company. We do not have the financial resources to build so many servers, so we use video uploading websites and referencing them in our App. Compared with multiple video websites, it seems that only one video meets the requirements. The reasons are as follows: 1. You cannot find the uploaded video in a video, so you can only watch the video in our App. 2. You can directly obtain the video URL through other services of a video website, instead of having a lot of additional information like a normal webpage.

You can use webview to directly connect to a video. There is no problem in android4.2, 4.3, but it cannot be played on android4.0. I don't know why. It directly shows that the video can be played normally on android 4.2 and 4.3, but cannot be played on android 4.0. In addition, the video will jump to one more link. It can run on the local UC browser. I checked that UC does not use flash for playback. I don't know whether webview is used for loading or local playback.

Back to the topic, the principle is quite simple. More than 4.0 jump links are actually video sources. Since there is a video source, you only need to write an html video tag, then, call the loaddata function of webview to call the local code. Note that: 1. A video source has a validity period. Therefore, you cannot fix the video source because 4.0 cannot be automatically played. 2. during video playback, links are automatically redirected (because mobile phones and PCs need to be differentiated). Therefore, webview's goback function cannot be used directly. Therefore, you need to maintain a stack that returns links.

The video source and video url are not the same. The video url is the playback address and the video source is the real video. What is recorded here is only for a video website. As for how to set webview, there should be a lot of online tutorials, such as this is good: Click to open the link

Related Article

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.