-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Captions #1749
Captions #1749
Changes from 226 commits
72b8883
55efd27
1a06519
354bc51
aefc333
408f84b
5ad1a3e
60f8fbb
64b9a91
76cabc3
a32c878
5011e9c
7de599a
7b9f388
10abed2
f8dea9f
4cb5a16
61bb044
e2b7781
b9b6036
d080061
3c95af5
c7f5d6f
336f2a7
84afdf8
4e7a9dc
dc108fb
86bd6a4
62584b7
cb44f21
0c6ba0e
bb67b1e
b9a4856
a233f5e
37834cf
09a04a7
26257c0
0b7dd8a
d674d90
a20dabd
380e26b
06637b0
3fc3e97
f6f5d93
22d33cb
4c9b314
93e27a4
98379cf
aa27dbd
71c7d3e
d5fe3e8
84941a4
fa3a535
af3399d
81e2f41
e28666f
0e45fd4
27182ee
7bb8416
2e48de9
addf8c1
631e1df
d8aa8e2
31df8fe
059371f
04478e2
b7231be
23d38de
cd8e7b2
3204811
c83e9b1
6629b7c
8b1b8a8
01a8811
374fe5b
ba78497
f1e1a86
18a2bc3
307aa25
b655aed
ef2868b
5673cc9
e6ba98f
66f447c
498169e
6da13b6
e915c3c
8d98ee5
2775c83
a46f6ef
03888f3
c150348
98d9c6f
c723789
ccc486f
a57bdfb
2ff8ab8
2a21a58
6acfe0b
c09ee04
bd00231
10a7dd5
9ee4cf6
987a3a9
b697131
664b956
87134bd
f46845e
b703c9b
6146bff
33759f1
fffbb37
8844528
5c76a6f
92f3b2c
d8426d6
ca4d6aa
5a43ebf
fe22a7a
1233dc2
a20dde6
0e2f78b
5270d7f
f6a1a74
78087de
33417f6
71c5040
b45bf98
641ec9a
d7b2217
5b68411
e2d1ff6
83d61b8
1967e50
1790762
a6b8978
6c541a5
6d8c210
8d7541d
852b1a3
89394cf
44bfb4a
9cda5ae
40a3aa0
48aef62
27b577a
7d702c9
3810375
bd1d644
41b00d6
ad3d7f5
9ed42b0
65a9654
3132f73
19e50b9
7fe913c
e8bce15
aa77591
896b003
507740a
0a8ff75
c37ccf0
701b34b
30ef22f
3d727df
b402b29
f9e913e
d21e507
4409722
b7c67c0
cb2f548
bf6acb1
64c1eba
0a62164
8714151
327f2e2
d760438
fb43f2e
e41f7f4
e427ec3
2b6635c
f3061b3
b053a5e
ac30558
8921e33
b53d895
34619a7
f6c7ea8
3374a86
f1a7802
998adf8
ceebeba
ee553a2
bd5fba5
bb557e8
206fb70
8466db7
2f8329b
e44e68d
e582a54
542fd09
56b90fc
7e5ddbf
d5943a6
5e4a7cd
9dd8bb8
9bc6445
f61ed8f
5968b25
0a131f2
3b4a15a
dd4d1d9
5c36d27
1638fe9
3a9f1c5
e202f9b
83a53af
dc84db9
8cd52ce
b248f2a
5093dfa
7a81c77
20f1455
5d20cc2
5f409b9
74a2d2d
59a8534
f59b3f0
f81280f
675bfc3
f932a28
58d27ff
ae46dbf
a576dc5
8748ab6
9ea5443
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -964,33 +964,92 @@ body.vjs-full-window { | |
/* Text Track Styles */ | ||
/* Overall track holder for both captions and subtitles */ | ||
.video-js .vjs-text-track-display { | ||
text-align: center; | ||
position: absolute; | ||
bottom: 4em; | ||
/* Leave padding on left and right */// | ||
left: 1em; | ||
right: 1em; | ||
top: 0; | ||
left: 0; | ||
bottom: 3em; | ||
right: 0; | ||
pointer-events: none; | ||
} | ||
|
||
/* Increase font-size when fullscreen */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there resource or discussion we can point to in the comment for why we're doing this? I actually don't know why myself. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm... I think this should be removed, though, it's actually not doing anything right now because vttjs overrides the font-size manually. I think it got added when I merged some stuff from master. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed. |
||
.video-js.vjs-fullscreen .vjs-text-track { font-size: 3em; } | ||
|
||
/* Captions Settings Dialog */ | ||
.vjs-caption-settings { | ||
position: relative; | ||
top: 1em; | ||
background-color: #000; | ||
opacity: 0.75; | ||
color: #FFF; | ||
margin: 0 auto; | ||
padding: 0.5em; | ||
height: 15em; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 12px; | ||
width: 40em; | ||
} | ||
|
||
.vjs-caption-settings .vjs-tracksettings { | ||
top: 0; | ||
bottom: 2em; | ||
left: 0; | ||
right: 0; | ||
position: absolute; | ||
overflow: auto; | ||
} | ||
|
||
.vjs-caption-settings .vjs-tracksettings-colors, | ||
.vjs-caption-settings .vjs-tracksettings-font { | ||
float: left; | ||
} | ||
.vjs-caption-settings .vjs-tracksettings-colors:after, | ||
.vjs-caption-settings .vjs-tracksettings-font:after, | ||
.vjs-caption-settings .vjs-tracksettings-controls:after { | ||
clear: both; | ||
} | ||
|
||
/* Move captions down when controls aren't being shown */ | ||
.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display { | ||
.vjs-caption-settings .vjs-tracksettings-controls { | ||
position: absolute; | ||
bottom: 1em; | ||
right: 1em; | ||
} | ||
|
||
/* Individual tracks */ | ||
.video-js .vjs-text-track { | ||
font-size: 1.4em; | ||
text-align: center; | ||
margin-bottom: 0.1em; | ||
/* Transparent black background, or fallback to all black (oldIE) */// | ||
.background-color-with-alpha(rgb(0, 0, 0), 0.5); | ||
.vjs-caption-settings .vjs-tracksetting { | ||
margin: 5px; | ||
padding: 3px; | ||
min-height: 40px; | ||
} | ||
.vjs-caption-settings .vjs-tracksetting label { | ||
display: block; | ||
width: 100px; | ||
margin-bottom: 5px; | ||
} | ||
.video-js .vjs-subtitles { color: #fff /* Subtitles are white */; } | ||
.video-js .vjs-captions { color: #fc6 /* Captions are yellow */; } | ||
.vjs-tt-cue { display: block; } | ||
|
||
/* Increase font-size when fullscreen */ | ||
.video-js.vjs-fullscreen .vjs-text-track { font-size: 3em; } | ||
.vjs-caption-settings .vjs-tracksetting span { | ||
display: inline; | ||
margin-left: 5px; | ||
} | ||
|
||
.vjs-caption-settings .vjs-tracksetting > div { | ||
margin-bottom: 5px; | ||
min-height: 20px; | ||
} | ||
|
||
.vjs-caption-settings .vjs-tracksetting > div:last-child { | ||
margin-bottom: 0; | ||
padding-bottom: 0; | ||
min-height: 0; | ||
} | ||
|
||
.vjs-caption-settings label > input { | ||
margin-right: 10px; | ||
} | ||
|
||
.vjs-caption-settings input[type="button"] { | ||
width: 40px; | ||
height: 40px; | ||
} | ||
|
||
/* Hide disabled or unsupported controls */ | ||
.vjs-hidden { display: none !important; } | ||
|
@@ -1006,15 +1065,15 @@ body.vjs-full-window { | |
This optional paragraph inside the video tag can provide a message to users | ||
about what's required to play video. */ | ||
.vjs-no-js { | ||
padding: 20px; | ||
padding: 2em; | ||
color: #ccc; | ||
background-color: #333; | ||
font-size: 18px; | ||
font-size: 1.8em; | ||
font-family: Arial, sans-serif; | ||
text-align: center; | ||
width: 300px; | ||
height: 150px; | ||
margin: 0px auto; | ||
width: 30em; | ||
height: 15em; | ||
margin: 0 auto; | ||
} | ||
|
||
.vjs-no-js a, .vjs-no-js a:visited { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
vjs.EventEmitter = function() { | ||
}; | ||
|
||
vjs.EventEmitter.prototype.allowedEvents_ = { | ||
}; | ||
|
||
vjs.EventEmitter.prototype.on = function(type, fn) { | ||
// Remove the addEventListener alias before calling vjs.on | ||
// so we don't get into an infinite type loop | ||
var ael = this.addEventListener; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should have a comment here about why this is needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed in 5c36d27 |
||
this.addEventListener = Function.prototype; | ||
vjs.on(this, type, fn); | ||
this.addEventListener = ael; | ||
}; | ||
vjs.EventEmitter.prototype.addEventListener = vjs.EventEmitter.prototype.on; | ||
|
||
vjs.EventEmitter.prototype.off = function(type, fn) { | ||
vjs.off(this, type, fn); | ||
}; | ||
vjs.EventEmitter.prototype.removeEventListener = vjs.EventEmitter.prototype.off; | ||
|
||
vjs.EventEmitter.prototype.one = function(type, fn) { | ||
vjs.one(this, type, fn); | ||
}; | ||
|
||
vjs.EventEmitter.prototype.trigger = function(event) { | ||
var type = event.type || event; | ||
|
||
if (typeof event === 'string') { | ||
event = { | ||
type: type | ||
}; | ||
} | ||
event = vjs.fixEvent(event); | ||
|
||
if (this.allowedEvents_[type] && this['on' + type]) { | ||
this['on' + type](event); | ||
} | ||
|
||
vjs.trigger(this, event); | ||
}; | ||
// The standard DOM EventTarget.dispatchEvent() is aliased to trigger() | ||
vjs.EventEmitter.prototype.dispatchEvent = vjs.EventEmitter.prototype.trigger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the recent merges mean we can change this to the main lib yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, not yet. All the IE8 changes went in but the shim build stuff still need to get tweaked first.