Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
677 views
in Technique[技术] by (71.8m points)

html - Chrome Html5 video can't display white, has gray background

We have an intro page which plays a html5 video before the main site content is displayed. The video has a white background so it integrates seemlessly with the page background. However, in the chrome browser the whole video has a gray background.

Apparently, these questions from 2011 indicate this was/is a bug in chromium. They also state the bug was gone in the latest chrome update. However, I downloaded the latest chrome version, 27.0.1453.110 m, and the problem is still there?

html 5- Videos - White is washed off in Chrome

Unwanted Background color/artifact on HTML5 Video Tag

enter image description here

Does anyone have any solution or workaround for this problem ? ... This bug renders our whole project useless ... It seems unbelievable to me that despite of the html5 hype, chrome can't play whites in videos since 2011 ??

....... EDIT ....................................................

Ok, I've created a jsfiddle project : http://jsfiddle.net/Ykmya/5/

<body>
<video id="introVideo" width="774" height="400"  oncanplay="playIntroVideo()">
    <source src="http://users.telenet.be/A-I/ChromeBugTest.mp4" type="video/mp4" />
    Uw browser ondersteunt geen html5 video
</video>
</body>

When viewed with Chrome, you will see the gray background

........ EDIT 2 ..................................................

using pandavengers answer, I added this css, which has an acceptable result :

@media screen and (-webkit-min-device-pixel-ratio:0) {
    video{ -webkit-filter: brightness(108.5%); }
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

http://jsfiddle.net/Ykmya/8/

Here's a simple fix, I simply upped the brightness using a webkit filter. I was going to draw it onto canvas and then filter the pixels, which should be much smoother, but I cannot access your video through cross-domains. Instead I just used the css style

video{
     -webkit-filter: brightness(108.5%); 
}

Edit: This has been fixed on the latest version of Chrome I believe.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...