[Go] Android 4.4 play HTML5 video <video> Bug

Source: Internet
Author: User

Recent Nexus 4 mobile phone automatic upgrade to Android4.4, originally quite good thing, the results found that their application appeared a bug, the application used the WebView play HTML5 video, the code is as follows:
<video width= "480" height= "280" poster= "test.jpg" src= "Test.mp4" preload= "Auto" ></video>

Play normal before the 4.3 version, the new version can only hear the sound when playing, and the picture stays in the original picture, that is, the picture in the poster property, but does not show the video animation, only click the Pause button, and then click the Play button again, the video animation will show normal.

Online access to a lot of foreign forums, found two similar feedback, but the solution is different, one of the methods is to use the CSS3-webkit-transform:translate3d (0, 0, 0) property to force open 3D rendering, you can make the video playback normal, But this method will cause the initial poster image to show only a bit, and then a flash over to stay in the video playback interface, click Play, video playback is all normal.

In addition, a similar feedback report was found in the official forum: Https://code.google.com/p/android/issues/detail?id=62145#makechanges
It is mentioned that this problem may be caused by the Preload property, only the setting preload= "None" can display the video, the official has confirmed the bug, and said that the next version will be updated. But by my testing, setting preload= "None" alone does not solve the problem completely, the video still has only sound, and the screen stays on the initial screen.

After many experiments, I combine the above two methods to solve the problem, the code is as follows:
<video width= "480" height= "280" poster= "test.jpg" src= "Test.mp4" preload= "None" ></video>

The default poster display is normal, click Play, the video sound screen display is also normal.

The cause of this bug is that I think the video started playing without starting 3D acceleration, causing the original poster image to not be refreshed to the video screen. Setting preload= "None" disables the automatic loading of the video, ensures that the poster screen is loaded correctly, and when the video is clicked,-webkit-transform:translate3d (0, 0, 0) ensures that 3D acceleration is turned on, Automatically refreshes the original screen of the poster.

Of course, the above reasons are speculation, the solution is also temporary, because this does not conform to the original definition of the HTML5 label, the future depends on whether the official next version of Android to solve the bug.

[Go] Android 4.4 play HTML5 video <video> Bug

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.