-
Notifications
You must be signed in to change notification settings - Fork 0
/
VideoD.htm
56 lines (52 loc) · 1.83 KB
/
VideoD.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<meta charset="UTF-8" />
<video playsinline controls style="
width: 100%; z-index: 2147483647;
position: fixed; left: 0; top: 0;
/* ↓ Replace `src` with whatsoever. */ "
src="tablet-tab-strip-3.webm"
onerror="
prompt( 'MediaError',
( 'code: ' + this.error.code + ', message: ' + this.error.message ) );
"
onplay="
console.log( ( this._ = new Date() ).toISOString() );
this._f( '#F0F' );"
onpause="this._f( '#0F0' );"
onseeking="this._f( '#0FF' );
"
onended="
prompt( 'Video ended.\nSeconds elapsed since last "play":',
( (new Date() - this._) / 1000 ) );
"
onloadstart="
document.body || ( document.body = document.getElementsByTagName( 'body' )[0] );
this._0 = true;
// ^ Lock variable for handling race condition of repeat calling rapidly.
this._f = function ( x0, x1, x2 ) {
( typeof x1 !== 'object' ) || ( x2 = x1 );
( this._0 ) && (
this._0 = false,
setTimeout( this._f, 100,
document.documentElement.style.backgroundColor,
document.body.style.opacity, this )
);
document.documentElement.style.backgroundColor = x0;
document.body.style.opacity = (
/^(?:undefined|object)$/.test( typeof x1 ) ? 0.6 : x1 );
( x2 ) && ( x2._0 = true );
};
"
></video>
<!--
Summary of the "_f" logic:
Expects 1 - 3 arguments:
"x0": Color of "document.documentElement" ("<html>") 's "background-color" to override.
"x1": [
May be either the transparency ("opacity") of the cloak; or the Element object.
When "opacity" unspecified: default 0.6. ]
"x2": The Element object of interoperation. (host Element)
Difference between applying style on "<html>" vs. "<body>":
"<html>": The whole viewport.
"<body>": The body content. (not necessarily full viewport)
For some browsers (primarily modern ones) there's no difference: style on "<body>" as on "<html>" equivalent.
-->