use thumbnail image as poster to suppress black screen flashes
This commit is contained in:
parent
d1fbe50319
commit
95dc46bc1a
@ -84,13 +84,16 @@ ImageLoader =
|
|||||||
video2 = $.el 'video'
|
video2 = $.el 'video'
|
||||||
$.one video2, 'loadeddata', => ImageLoader.replaceVideo clone, video2
|
$.one video2, 'loadeddata', => ImageLoader.replaceVideo clone, video2
|
||||||
video2.src = video.src
|
video2.src = video.src
|
||||||
|
if chrome?
|
||||||
|
# This supresses black screen flashes in Chromium, but causes loading image icon flash in Firefox.
|
||||||
|
video.poster = thumb.src
|
||||||
|
video.loop = true
|
||||||
video.textContent = thumb.alt
|
video.textContent = thumb.alt
|
||||||
video.dataset.md5 = thumb.dataset.md5
|
video.dataset.md5 = thumb.dataset.md5
|
||||||
video.style.height = style.height
|
video.style.height = style.height
|
||||||
video.style.width = style.width
|
video.style.width = style.width
|
||||||
video.style.maxHeight = style.maxHeight
|
video.style.maxHeight = style.maxHeight
|
||||||
video.style.maxWidth = style.maxWidth
|
video.style.maxWidth = style.maxWidth
|
||||||
video.loop = true
|
|
||||||
video.className = thumb.className
|
video.className = thumb.className
|
||||||
$.on video, 'mouseover', ImageHover.mouseover if Conf['Image Hover']
|
$.on video, 'mouseover', ImageHover.mouseover if Conf['Image Hover']
|
||||||
$.replace thumb, video
|
$.replace thumb, video
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user