Skip to content
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

Closed
wants to merge 236 commits into from
Closed
Show file tree
Hide file tree
Changes from 226 commits
Commits
Show all changes
236 commits
Select commit Hold shift + click to select a range
72b8883
Support native captions in html5 tech.
gkatsev Nov 11, 2014
55efd27
Re-add text tracks on 'movingMediaElementInDOM'
gkatsev Nov 11, 2014
1a06519
Use custom tracks if no native textTracks support
gkatsev Nov 13, 2014
354bc51
Use setAttribute and 'in' so IE8 doesn't feak out.
gkatsev Nov 14, 2014
aefc333
Firefox gets custom captions for now
gkatsev Nov 17, 2014
408f84b
Move as much as possible into techs.
gkatsev Nov 17, 2014
5ad1a3e
Fix tests. Assume native text tracks, intially
gkatsev Nov 17, 2014
60f8fbb
Add tracks to texttrackdisplay on ready
gkatsev Nov 17, 2014
64b9a91
Add tracks buttons async
gkatsev Nov 17, 2014
76cabc3
Create custom tracks with the correct player
gkatsev Nov 17, 2014
a32c878
Move addTextTrack fully into techs.
gkatsev Nov 17, 2014
5011e9c
Move controlbar addition into player
gkatsev Nov 17, 2014
7de599a
In Html5, support tech, support non native tracks
gkatsev Nov 17, 2014
7b9f388
Add an 'update' method to menu
gkatsev Nov 18, 2014
10abed2
Move tracks buttons to controlbar children
gkatsev Nov 18, 2014
f8dea9f
Update tracks buttons if needed
gkatsev Nov 18, 2014
4cb5a16
Stub out ready and addChild for player
gkatsev Nov 18, 2014
61bb044
A whole bunch of tests
gkatsev Nov 18, 2014
e2b7781
Appease jshint.
gkatsev Nov 18, 2014
b9b6036
reset prototype value in media test
gkatsev Nov 18, 2014
d080061
appease phantomjs
gkatsev Nov 18, 2014
3c95af5
Extern/export addTextTrack
gkatsev Nov 19, 2014
c7f5d6f
Update tests to work when minified
gkatsev Nov 19, 2014
336f2a7
have vjs do the "addChild" "magic"
gkatsev Nov 19, 2014
84afdf8
Rename featuresNativeTracks to featuresTextTracks
gkatsev Nov 19, 2014
4e7a9dc
Move textTracks_ into tech
gkatsev Nov 19, 2014
dc108fb
Update text track btns based on add/remove events
gkatsev Nov 19, 2014
86bd6a4
Update tests
gkatsev Nov 19, 2014
62584b7
Rename volumeMenuButton's update to volumeUpdate
gkatsev Nov 25, 2014
cb44f21
Add a text track to test video
gkatsev Nov 25, 2014
0c6ba0e
Update html5 tech to use test_vid tracks
gkatsev Nov 25, 2014
bb67b1e
Add a number mode to test
gkatsev Nov 25, 2014
b9a4856
Get 'mode' as a string so gcc won't squash it
gkatsev Nov 25, 2014
a233f5e
Add comment, remove extra vertical whitespace
gkatsev Nov 25, 2014
37834cf
Remove extra whitespace and unused var
gkatsev Nov 25, 2014
09a04a7
Use vtt.js for track element emulation
dmlap Nov 24, 2014
26257c0
Finish moving lazy load
dmlap Nov 24, 2014
0b7dd8a
Fix styling.
dmlap Nov 24, 2014
d674d90
Remove obsolete cue parsing test
dmlap Nov 25, 2014
a20dabd
Allow overriding vtt.js URL
dmlap Nov 25, 2014
380e26b
Support native captions in html5 tech.
gkatsev Nov 11, 2014
06637b0
Use custom tracks if no native textTracks support
gkatsev Nov 13, 2014
3fc3e97
Firefox gets custom captions for now
gkatsev Nov 17, 2014
f6f5d93
Add tracks buttons async
gkatsev Nov 17, 2014
22d33cb
Move controlbar addition into player
gkatsev Nov 17, 2014
4c9b314
Move tracks buttons to controlbar children
gkatsev Nov 18, 2014
93e27a4
A whole bunch of tests
gkatsev Nov 18, 2014
98379cf
Appease jshint.
gkatsev Nov 18, 2014
aa27dbd
appease phantomjs
gkatsev Nov 18, 2014
71c7d3e
Update tests to work when minified
gkatsev Nov 19, 2014
d5fe3e8
Rename featuresNativeTracks to featuresTextTracks
gkatsev Nov 19, 2014
84941a4
Update tests
gkatsev Nov 19, 2014
fa3a535
Update html5 tech to use test_vid tracks
gkatsev Nov 25, 2014
af3399d
Add a number mode to test
gkatsev Nov 25, 2014
81e2f41
Get 'mode' as a string so gcc won't squash it
gkatsev Nov 25, 2014
e28666f
Add comment, remove extra vertical whitespace
gkatsev Nov 25, 2014
0e45fd4
Remove extra whitespace and unused var
gkatsev Nov 25, 2014
27182ee
Use vtt.js for track element emulation
dmlap Nov 24, 2014
7bb8416
Finish moving lazy load
dmlap Nov 24, 2014
2e48de9
caption-settings menu
gkatsev Nov 26, 2014
addf8c1
Rename caption settings to text track settings
gkatsev Nov 26, 2014
631e1df
appease jshint
gkatsev Nov 26, 2014
d8aa8e2
Forgot an 's'
gkatsev Nov 26, 2014
31df8fe
Hook up track customization to track display
dmlap Nov 26, 2014
059371f
Add fontSize and update styles on change
gkatsev Nov 26, 2014
04478e2
Make defaults button work
gkatsev Nov 26, 2014
b7231be
Don't show caption settings for native captions
gkatsev Nov 26, 2014
23d38de
Don't add caption button if no captions available
gkatsev Nov 26, 2014
cd8e7b2
Do a null check against tech
gkatsev Nov 26, 2014
3204811
Set a threshold for hiding captions button
gkatsev Nov 26, 2014
c83e9b1
Begin cleaning up captions settings HTML
dmlap Nov 27, 2014
6629b7c
More caption settings cleanup
dmlap Nov 27, 2014
8b1b8a8
Prefix classnames. Adjust selectors
dmlap Nov 27, 2014
01a8811
Support native captions in html5 tech.
gkatsev Nov 11, 2014
374fe5b
Update tests
gkatsev Nov 19, 2014
ba78497
caption-settings menu
gkatsev Nov 26, 2014
f1e1a86
Don't show caption settings for native captions
gkatsev Nov 26, 2014
18a2bc3
Do a null check against tech
gkatsev Nov 26, 2014
307aa25
Add IS_IE8 property
gkatsev Dec 2, 2014
b655aed
Add a TextTrackCueList shim
gkatsev Dec 2, 2014
ef2868b
Add TextTrackKind and TextTrackMode enums
gkatsev Dec 2, 2014
5673cc9
Move some files around
gkatsev Dec 3, 2014
e6ba98f
Add an EventEmitter object
gkatsev Dec 3, 2014
66f447c
TextTrack shim
gkatsev Dec 3, 2014
498169e
Add TextTrackList
gkatsev Dec 3, 2014
6da13b6
Fire cuechange from TextTrackList.
gkatsev Dec 4, 2014
e915c3c
Update source loader
gkatsev Dec 4, 2014
8d98ee5
JSHint fixes
gkatsev Dec 4, 2014
2775c83
have karma glob all source files
gkatsev Dec 5, 2014
a46f6ef
move tracks.js to tracks/tracks.js
gkatsev Dec 5, 2014
03888f3
add TextTrackList unit tests
gkatsev Dec 5, 2014
c150348
TextTrack 'change' event tests.
gkatsev Dec 6, 2014
98d9c6f
TextTrackCueList tests.
gkatsev Dec 6, 2014
c723789
TextTrack tests.
gkatsev Dec 7, 2014
ccc486f
Add vjs.fn.isNative
gkatsev Dec 10, 2014
a57bdfb
alias addEventListener/removeEventListener::on/off
gkatsev Dec 10, 2014
2ff8ab8
Make sure that tracks is an array
gkatsev Dec 10, 2014
2a21a58
Add built-in tracks automatically
gkatsev Dec 10, 2014
6acfe0b
Add WebVTT and API and display captions.
gkatsev Dec 10, 2014
c09ee04
Simple update for saner cuechange events.
gkatsev Dec 10, 2014
bd00231
Remove unused addTextTracks method
gkatsev Dec 11, 2014
10a7dd5
Add remoteTextTracks and removeRemoteTextTracks.
gkatsev Dec 11, 2014
9ee4cf6
Rework displaying of captions
gkatsev Dec 11, 2014
987a3a9
IE8 fixes
gkatsev Dec 12, 2014
b697131
JShint
gkatsev Dec 12, 2014
664b956
Remove event listeners on dispose
dmlap Dec 16, 2014
87134bd
Merge in dropped styling changes
dmlap Dec 17, 2014
f46845e
Remove copying Remove copying
dmlap Dec 17, 2014
b703c9b
Semicolon and put player on 'tt'
gkatsev Dec 17, 2014
6146bff
Player is on tt var
gkatsev Dec 17, 2014
33759f1
remove the track from textTracks() as well
gkatsev Dec 17, 2014
fffbb37
Only add text track menu items when labels are present
dmlap Dec 17, 2014
8844528
Move updateDisplay to TextTrackDisplay
gkatsev Dec 17, 2014
5c76a6f
Update text track display on track add/remove/change
gkatsev Dec 17, 2014
92f3b2c
Make sure that text track display is available
gkatsev Dec 17, 2014
d8426d6
Use addEventListener for tracks
gkatsev Dec 17, 2014
ca4d6aa
Always updateDisplay on TextTrackDisplay
gkatsev Dec 18, 2014
5a43ebf
Fire cuechange on once per change.
gkatsev Dec 18, 2014
fe22a7a
Add native captions to remoteTextTracks.
gkatsev Dec 18, 2014
1233dc2
Better addEventListener handling.
gkatsev Dec 19, 2014
a20dde6
Explain native text tracks support decision.
gkatsev Dec 19, 2014
0e2f78b
rename caption-settings.js to text-track-settings.js
gkatsev Dec 19, 2014
5270d7f
Throw in addTextTrack when kind not provided
gkatsev Dec 19, 2014
f6a1a74
Rename featuresTextTrack to featuresNativeTextTrack
gkatsev Dec 19, 2014
78087de
Player isn't optional for TextTrack
gkatsev Dec 19, 2014
33417f6
get rid of getProp
gkatsev Dec 19, 2014
71c5040
appease jshint
gkatsev Dec 19, 2014
b45bf98
Normalize IE9 URL parsing. Fix for #1764
dmlap Dec 22, 2014
641ec9a
Quote methods for closure compiler
dmlap Dec 22, 2014
d7b2217
Merge branch 'hotfix/ie-accidental-xdr' into tt-with-style
dmlap Dec 22, 2014
5b68411
Merge pull request #7 from dmlap/tt-with-style
gkatsev Dec 22, 2014
e2d1ff6
Return empty array from textTrack if not ready yet.
gkatsev Dec 22, 2014
83d61b8
Fix text-track-list tests.
gkatsev Dec 22, 2014
1967e50
Removed invalid test
gkatsev Dec 22, 2014
1790762
Add removeEventListener too
gkatsev Dec 22, 2014
a6b8978
Update test to reflect where we're looking for tracks
gkatsev Dec 22, 2014
6c541a5
Move native text track feature detection to a func
gkatsev Dec 22, 2014
6d8c210
Switch from each to forloop for tracks array
gkatsev Dec 22, 2014
8d7541d
Remove trailing comma
gkatsev Dec 22, 2014
852b1a3
Fix forloop
gkatsev Dec 22, 2014
89394cf
listen to track's onload to set mode to 'disabled'
gkatsev Dec 22, 2014
44bfb4a
Move text track init into functions from ctor.
gkatsev Dec 22, 2014
9cda5ae
Add semicolons
gkatsev Dec 22, 2014
40a3aa0
Fix up tests and move some dispose listeners
gkatsev Dec 22, 2014
48aef62
Don't need a dispose listener on player
gkatsev Dec 22, 2014
27b577a
Add text track buttons update themselves on changes.
gkatsev Dec 22, 2014
7d702c9
Make textTrackDisplay a child of player.
gkatsev Dec 22, 2014
3810375
Update tests. textTracks shouldn't return empty array
gkatsev Dec 22, 2014
bd1d644
Move tracks/player-api.js back into player.js
gkatsev Dec 22, 2014
41b00d6
Update TextTrackMenuItems when text tracks change.
gkatsev Dec 23, 2014
ad3d7f5
Remove showTextTrack from Player's prototype.
gkatsev Dec 23, 2014
9ed42b0
Update button tests. Move event handler to ctor.
gkatsev Dec 23, 2014
65a9654
Remove cue from other text tracks.
gkatsev Dec 23, 2014
3132f73
addtrack and removetrack need to have the track
gkatsev Dec 23, 2014
19e50b9
Appease jshint
gkatsev Dec 23, 2014
7fe913c
Run source-loader to get correct order of files in karma
gkatsev Dec 23, 2014
e8bce15
Fixup tests
gkatsev Dec 23, 2014
aa77591
Export all the things (that are necessary).
gkatsev Dec 23, 2014
896b003
Added settings and player API tests
Dec 23, 2014
507740a
Merging upstream
Dec 23, 2014
0a8ff75
Renamed control tests file
Dec 23, 2014
c37ccf0
Updating qunit page to reflect file rename
Dec 23, 2014
701b34b
fixup text track settings styles
gkatsev Dec 23, 2014
30ef22f
Merge upstream and adding to exports
Dec 23, 2014
3d727df
Merge pull request #8 from forbesjo/tt-with-style
gkatsev Dec 23, 2014
b402b29
Fixed typo
forbesjo Dec 23, 2014
f9e913e
Added missing exports for removeRemoteTextTrack
forbesjo Dec 23, 2014
d21e507
Merge branch 'master' into tt-with-style
gkatsev Dec 23, 2014
4409722
Check presence of vjs-hidden class
gkatsev Dec 23, 2014
b7c67c0
Change text track settings button text to "Done".
gkatsev Dec 23, 2014
cb2f548
Switch font size to be percents
gkatsev Dec 24, 2014
bf6acb1
Keep captions inside player
gkatsev Dec 24, 2014
64c1eba
Correct default for font size percent
gkatsev Dec 24, 2014
0a62164
Add a test for cuechange.
gkatsev Dec 24, 2014
8714151
No longer have font +/- buttons
gkatsev Dec 24, 2014
327f2e2
Persist text track settings via an option.
gkatsev Dec 24, 2014
d760438
Don't do anything special for fontPercent 1.
gkatsev Dec 29, 2014
fb43f2e
Restore font size properly
gkatsev Dec 29, 2014
e41f7f4
Be more responsive in text track settings.
gkatsev Dec 29, 2014
e427ec3
Check captionsButton items
Dec 30, 2014
2b6635c
Adding some track settings tests
Dec 30, 2014
f3061b3
Fixing copy/paste
Dec 30, 2014
b053a5e
Fix makePlayer
Dec 30, 2014
ac30558
Adding settings tests
Dec 30, 2014
8921e33
Don't throw from removeCue.
gkatsev Dec 30, 2014
b53d895
Do not save if settings are same as default
Dec 30, 2014
34619a7
update tests
Dec 30, 2014
f6c7ea8
Html5's addRemoteTextTrack will return the track element
gkatsev Dec 31, 2014
3374a86
Detect mode change event support and polyfill it if necessary
dmlap Dec 31, 2014
f1a7802
Merge pull request #9 from dmlap/tt-with-style
gkatsev Jan 5, 2015
998adf8
Loop through allowedEvents to add 'on' events
gkatsev Jan 5, 2015
ceebeba
Return object containing track for emulated capts
gkatsev Jan 5, 2015
ee553a2
Export EventEmitter. Fix minifcation issues.
gkatsev Jan 5, 2015
bd5fba5
TextTrackDisplay bottom is 3em to be above ctrlbar
gkatsev Jan 5, 2015
bb557e8
Default metadata to hidden. cuechange for hidden
gkatsev Jan 6, 2015
206fb70
Better handling of default hidden for metadata.
gkatsev Jan 6, 2015
8466db7
Fix to hide subtitles button for ads
Jan 6, 2015
2f8329b
language could also be 'srclang'
gkatsev Jan 7, 2015
e44e68d
Native track languge is 'srclang'
gkatsev Jan 7, 2015
e582a54
Accept srclang or langauge for addRemoteTextTrack
gkatsev Jan 7, 2015
542fd09
forgot a ||
gkatsev Jan 7, 2015
56b90fc
Update text track display on fullscreen change
gkatsev Jan 8, 2015
7e5ddbf
Wrap try/catch around background color styles
gkatsev Jan 8, 2015
d5943a6
Use tt and not this in TextTrack object
gkatsev Jan 8, 2015
5e4a7cd
ManualTimeUpdatesOff was not de-registering events
gkatsev Jan 9, 2015
9dd8bb8
Merge branch 'hotfix/timeupdatesoff' into tt-with-style
gkatsev Jan 9, 2015
9bc6445
fixup tests
gkatsev Jan 9, 2015
f61ed8f
Merge branch 'hotfix/timeupdatesoff' into tt-with-style
gkatsev Jan 9, 2015
5968b25
Update vttjs build. Don't shim VTTCue but vttjs's.
gkatsev Jan 22, 2015
0a131f2
Add a vttjs grunt task.
gkatsev Jan 22, 2015
3b4a15a
Append vttjs to the end of files
gkatsev Jan 23, 2015
dd4d1d9
Don't bow down to the closure compiler gods
gkatsev Jan 23, 2015
5c36d27
Add a comment explaining EventEmitter#on removing aEL
gkatsev Jan 23, 2015
1638fe9
it's featuresNativeTextTracks
gkatsev Jan 23, 2015
3a9f1c5
Don't use isNaN. Check manually for bad values
gkatsev Jan 23, 2015
e202f9b
Don't run in IE8 that don't work properly there
gkatsev Jan 23, 2015
83a53af
Fix Chapters.
gkatsev Jan 24, 2015
dc84db9
Bracket access cues
gkatsev Jan 24, 2015
8cd52ce
Merge branch 'master' into tt-with-style
gkatsev Jan 26, 2015
b248f2a
Fixup package.json
gkatsev Jan 26, 2015
5093dfa
Appease jshint
gkatsev Jan 26, 2015
7a81c77
pretend that text tracks have loaded
gkatsev Jan 26, 2015
20f1455
Don't hide tracks with no label.
gkatsev Jan 26, 2015
5d20cc2
Move text track display to before big play button.
gkatsev Jan 28, 2015
5f409b9
Auto-load tracks without a source
gkatsev Jan 28, 2015
74a2d2d
Exit early from updateForTrack if activeCues null
gkatsev Jan 28, 2015
59a8534
Duck type track.cues/activeCues with getTrackById
gkatsev Feb 13, 2015
f59b3f0
Add TODO and more info in comment
gkatsev Feb 13, 2015
f81280f
Remove unnecessary style rule
gkatsev Feb 13, 2015
675bfc3
Add TODO to investigate native captions in firefox
gkatsev Feb 13, 2015
f932a28
Add TODO to move initTextTrackListeners
gkatsev Feb 13, 2015
58d27ff
Add TODO to Chapters' setTimeout.
gkatsev Feb 13, 2015
ae46dbf
Remove duplicate test
gkatsev Feb 13, 2015
a576dc5
Merge branch 'master' into tt-with-style
gkatsev Feb 13, 2015
8748ab6
fixup less comment issue
gkatsev Feb 13, 2015
9ea5443
Cue lists have a getCueById method.
gkatsev Feb 13, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 23 additions & 1 deletion Gruntfile.js
Expand Up @@ -338,7 +338,7 @@ module.exports = function(grunt) {
// grunt.loadTasks('./docs/tasks/');
// grunt.loadTasks('../videojs-doc-generator/tasks/');

grunt.registerTask('pretask', ['jshint', 'less', 'vjslanguages', 'build', 'minify', 'usebanner']);
grunt.registerTask('pretask', ['jshint', 'less', 'vjslanguages', 'build', 'minify', 'vttjs', 'usebanner']);
// Default task.
grunt.registerTask('default', ['pretask', 'dist']);
// Development watch task
Expand Down Expand Up @@ -431,6 +431,26 @@ module.exports = function(grunt) {

var fs = require('fs');

grunt.registerTask('vttjs', 'prepend vttjs to videojs source files', function() {
var vttjs, vttjsMin, vjs, vjsMin;

// copy the current files to make a novttjs build
grunt.file.copy('build/files/combined.video.js', 'build/files/combined.video.novtt.js');
grunt.file.copy('build/files/minified.video.js', 'build/files/minified.video.novtt.js');

// read in vttjs files
vttjs = grunt.file.read('node_modules/vtt.js/dist/vtt.js');
vttjsMin = grunt.file.read('node_modules/vtt.js/dist/vtt.min.js');

// read in videojs files
vjs = grunt.file.read('build/files/combined.video.js');
vjsMin = grunt.file.read('build/files/minified.video.js');

// write out the concatenated files
grunt.file.write('build/files/combined.video.js', vjs + '\n' + vttjs);
grunt.file.write('build/files/minified.video.js', vjsMin + '\n' + vttjsMin);
});

grunt.registerMultiTask('build', 'Building Source', function(){

// Fix windows file path delimiter issue
Expand Down Expand Up @@ -531,6 +551,8 @@ module.exports = function(grunt) {
// Manually copy each source file
grunt.file.copy('build/files/minified.video.js', 'dist/video-js/video.js');
grunt.file.copy('build/files/combined.video.js', 'dist/video-js/video.dev.js');
grunt.file.copy('build/files/minified.video.novtt.js', 'dist/video-js/video.novtt.js');
grunt.file.copy('build/files/combined.video.novtt.js', 'dist/video-js/video.novtt.dev.js');
grunt.file.copy('build/files/video-js.css', 'dist/video-js/video-js.css');
grunt.file.copy('build/files/video-js.min.css', 'dist/video-js/video-js.min.css');
grunt.file.copy('node_modules/videojs-swf/dist/video-js.swf', 'dist/video-js/video-js.swf');
Expand Down
8 changes: 7 additions & 1 deletion build/source-loader.js
Expand Up @@ -21,6 +21,7 @@ var sourceFiles = [
"src/js/lib.js",
"src/js/xhr.js",
"src/js/util.js",
"src/js/event-emitter.js",
"src/js/component.js",
"src/js/button.js",
"src/js/slider.js",
Expand All @@ -47,7 +48,12 @@ var sourceFiles = [
"src/js/media/flash.js",
"src/js/media/flash.rtmp.js",
"src/js/media/loader.js",
"src/js/tracks.js",
"src/js/tracks/text-track-enums.js",
"src/js/tracks/text-track.js",
"src/js/tracks/text-track-list.js",
"src/js/tracks/text-track-cue-list.js",
"src/js/tracks/text-track-controls.js",
"src/js/tracks/text-track-settings.js",
"src/js/json.js",
"src/js/setup.js",
"src/js/plugins.js"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -21,7 +21,8 @@
},
"main": "./dist/video-js/video.js",
"dependencies": {
"videojs-swf": "4.5.3"
"videojs-swf": "4.5.3",
"vtt.js": "git+https://github.com/gkatsev/vtt.js.git#shim-build"
Copy link
Member

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?

Copy link
Member Author

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.

},
"devDependencies": {
"calcdeps": "~0.1.7",
Expand Down
107 changes: 83 additions & 24 deletions src/css/video-js.less
Expand Up @@ -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 */
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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; }
Expand All @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion src/js/control-bar/control-bar.js
Expand Up @@ -22,7 +22,10 @@ vjs.ControlBar.prototype.options_ = {
'volumeControl': {},
'muteToggle': {},
// 'volumeMenuButton': {},
'playbackRateMenuButton': {}
'playbackRateMenuButton': {},
'subtitlesButton': {},
'captionsButton': {},
'chaptersButton': {}
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/js/control-bar/volume-menu-button.js
Expand Up @@ -8,7 +8,7 @@ vjs.VolumeMenuButton = vjs.MenuButton.extend({
vjs.MenuButton.call(this, player, options);

// Same listeners as MuteToggle
this.on(player, 'volumechange', this.update);
this.on(player, 'volumechange', this.volumeUpdate);

// hide mute toggle if the current tech doesn't support volume control
if (player.tech && player.tech['featuresVolumeControl'] === false) {
Expand Down Expand Up @@ -51,4 +51,4 @@ vjs.VolumeMenuButton.prototype.createEl = function(){
innerHTML: '<div><span class="vjs-control-text">' + this.localize('Mute') + '</span></div>'
});
};
vjs.VolumeMenuButton.prototype.update = vjs.MuteToggle.prototype.update;
vjs.VolumeMenuButton.prototype.volumeUpdate = vjs.MuteToggle.prototype.update;
5 changes: 3 additions & 2 deletions src/js/core.js
Expand Up @@ -115,11 +115,12 @@ vjs.options = {
'children': {
'mediaLoader': {},
'posterImage': {},
'textTrackDisplay': {},
'loadingSpinner': {},
'textTrackDisplay': {},
'bigPlayButton': {},
'controlBar': {},
'errorDisplay': {}
'errorDisplay': {},
'textTrackSettings': {}
},

'language': document.getElementsByTagName('html')[0].getAttribute('lang') || navigator.languages && navigator.languages[0] || navigator.userLanguage || navigator.language || 'en',
Expand Down
43 changes: 43 additions & 0 deletions src/js/event-emitter.js
@@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a comment here about why this is needed.

Copy link
Member Author

Choose a reason for hiding this comment

The 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;
39 changes: 39 additions & 0 deletions src/js/exports.js
Expand Up @@ -71,6 +71,16 @@ goog.exportProperty(vjs.Component.prototype, 'localize', vjs.Component.prototype
goog.exportProperty(vjs.Component.prototype, 'setInterval', vjs.Component.prototype.setInterval);
goog.exportProperty(vjs.Component.prototype, 'setTimeout', vjs.Component.prototype.setTimeout);

goog.exportSymbol('videojs.EventEmitter', vjs.EventEmitter);
goog.exportProperty(vjs.EventEmitter.prototype, 'on', vjs.EventEmitter.prototype.on);
goog.exportProperty(vjs.EventEmitter.prototype, 'addEventListener', vjs.EventEmitter.prototype.addEventListener);
goog.exportProperty(vjs.EventEmitter.prototype, 'off', vjs.EventEmitter.prototype.off);
goog.exportProperty(vjs.EventEmitter.prototype, 'removeEventListener', vjs.EventEmitter.prototype.removeEventListener);
goog.exportProperty(vjs.EventEmitter.prototype, 'one', vjs.EventEmitter.prototype.one);
goog.exportProperty(vjs.EventEmitter.prototype, 'trigger', vjs.EventEmitter.prototype.trigger);
goog.exportProperty(vjs.EventEmitter.prototype, 'dispatchEvent', vjs.EventEmitter.prototype.dispatchEvent);


// Need to export ended to ensure it's not removed by CC, since it's not used internally
goog.exportProperty(vjs.Player.prototype, 'ended', vjs.Player.prototype.ended);
goog.exportProperty(vjs.Player.prototype, 'enterFullWindow', vjs.Player.prototype.enterFullWindow);
Expand All @@ -85,6 +95,11 @@ goog.exportProperty(vjs.Player.prototype, 'cancelFullScreen', vjs.Player.prototy
goog.exportProperty(vjs.Player.prototype, 'exitFullscreen', vjs.Player.prototype.exitFullscreen);
goog.exportProperty(vjs.Player.prototype, 'isFullScreen', vjs.Player.prototype.isFullScreen);
goog.exportProperty(vjs.Player.prototype, 'isFullscreen', vjs.Player.prototype.isFullscreen);
goog.exportProperty(vjs.Player.prototype, 'textTracks', vjs.Player.prototype.textTracks);
goog.exportProperty(vjs.Player.prototype, 'remoteTextTracks', vjs.Player.prototype.remoteTextTracks);
goog.exportProperty(vjs.Player.prototype, 'addTextTrack', vjs.Player.prototype.addTextTrack);
goog.exportProperty(vjs.Player.prototype, 'addRemoteTextTrack', vjs.Player.prototype.addRemoteTextTrack);
goog.exportProperty(vjs.Player.prototype, 'removeRemoteTextTrack', vjs.Player.prototype.removeRemoteTextTrack);

goog.exportSymbol('videojs.MediaLoader', vjs.MediaLoader);
goog.exportSymbol('videojs.TextTrackDisplay', vjs.TextTrackDisplay);
Expand Down Expand Up @@ -118,6 +133,12 @@ goog.exportSymbol('videojs.Menu', vjs.Menu);
goog.exportSymbol('videojs.MenuItem', vjs.MenuItem);
goog.exportSymbol('videojs.MenuButton', vjs.MenuButton);
goog.exportSymbol('videojs.PlaybackRateMenuButton', vjs.PlaybackRateMenuButton);
goog.exportSymbol('videojs.ChaptersTrackMenuItem', vjs.ChaptersTrackMenuItem);
goog.exportSymbol('videojs.TextTrackButton', vjs.TextTrackButton);
goog.exportSymbol('videojs.TextTrackMenuItem', vjs.TextTrackMenuItem);
goog.exportSymbol('videojs.OffTextTrackMenuItem', vjs.OffTextTrackMenuItem);
goog.exportSymbol('videojs.CaptionSettingsMenuItem', vjs.CaptionSettingsMenuItem);

goog.exportProperty(vjs.MenuButton.prototype, 'createItems', vjs.MenuButton.prototype.createItems);
goog.exportProperty(vjs.TextTrackButton.prototype, 'createItems', vjs.TextTrackButton.prototype.createItems);
goog.exportProperty(vjs.ChaptersButton.prototype, 'createItems', vjs.ChaptersButton.prototype.createItems);
Expand All @@ -134,6 +155,11 @@ goog.exportProperty(vjs.MediaTechController.prototype, 'featuresPlaybackRate', v
goog.exportProperty(vjs.MediaTechController.prototype, 'featuresProgressEvents', vjs.MediaTechController.prototype.featuresProgressEvents);
goog.exportProperty(vjs.MediaTechController.prototype, 'featuresTimeupdateEvents', vjs.MediaTechController.prototype.featuresTimeupdateEvents);
goog.exportProperty(vjs.MediaTechController.prototype, 'setPoster', vjs.MediaTechController.prototype.setPoster);
goog.exportProperty(vjs.MediaTechController.prototype, 'textTracks', vjs.MediaTechController.prototype.textTracks);
goog.exportProperty(vjs.MediaTechController.prototype, 'remoteTextTracks', vjs.MediaTechController.prototype.remoteTextTracks);
goog.exportProperty(vjs.MediaTechController.prototype, 'addTextTrack', vjs.MediaTechController.prototype.addTextTrack);
goog.exportProperty(vjs.MediaTechController.prototype, 'addRemoteTextTrack', vjs.MediaTechController.prototype.addRemoteTextTrack);
goog.exportProperty(vjs.MediaTechController.prototype, 'removeRemoteTextTrack', vjs.MediaTechController.prototype.removeRemoteTextTrack);

goog.exportSymbol('videojs.Html5', vjs.Html5);
goog.exportProperty(vjs.Html5, 'Events', vjs.Html5.Events);
Expand All @@ -159,6 +185,11 @@ goog.exportProperty(vjs.Html5, 'registerSourceHandler', vjs.Html5.registerSource
goog.exportProperty(vjs.Html5, 'selectSourceHandler', vjs.Html5.selectSourceHandler);
goog.exportProperty(vjs.Html5.prototype, 'setSource', vjs.Html5.prototype.setSource);
goog.exportProperty(vjs.Html5.prototype, 'disposeSourceHandler', vjs.Html5.prototype.disposeSourceHandler);
goog.exportProperty(vjs.Html5.prototype, 'textTracks', vjs.Html5.prototype.textTracks);
goog.exportProperty(vjs.Html5.prototype, 'remoteTextTracks', vjs.Html5.prototype.remoteTextTracks);
goog.exportProperty(vjs.Html5.prototype, 'addTextTrack', vjs.Html5.prototype.addTextTrack);
goog.exportProperty(vjs.Html5.prototype, 'addRemoteTextTrack', vjs.Html5.prototype.addRemoteTextTrack);
goog.exportProperty(vjs.Html5.prototype, 'removeRemoteTextTrack', vjs.Html5.prototype.removeRemoteTextTrack);

goog.exportSymbol('videojs.Flash', vjs.Flash);
goog.exportProperty(vjs.Flash, 'isSupported', vjs.Flash.isSupported);
Expand All @@ -174,11 +205,19 @@ goog.exportProperty(vjs.Flash.prototype, 'setSource', vjs.Flash.prototype.setSou
goog.exportProperty(vjs.Flash.prototype, 'disposeSourceHandler', vjs.Flash.prototype.disposeSourceHandler);

goog.exportSymbol('videojs.TextTrack', vjs.TextTrack);
goog.exportSymbol('videojs.TextTrackList', vjs.TextTrackList);
goog.exportSymbol('videojs.TextTrackCueList', vjs.TextTrackCueList);
goog.exportSymbol('videojs.TextTrackSettings', vjs.TextTrackSettings);
goog.exportProperty(vjs.TextTrack.prototype, 'id', vjs.TextTrack.prototype.id);
goog.exportProperty(vjs.TextTrack.prototype, 'label', vjs.TextTrack.prototype.label);
goog.exportProperty(vjs.TextTrack.prototype, 'kind', vjs.TextTrack.prototype.kind);
goog.exportProperty(vjs.TextTrack.prototype, 'mode', vjs.TextTrack.prototype.mode);
goog.exportProperty(vjs.TextTrack.prototype, 'cues', vjs.TextTrack.prototype.cues);
goog.exportProperty(vjs.TextTrack.prototype, 'activeCues', vjs.TextTrack.prototype.activeCues);
goog.exportProperty(vjs.TextTrack.prototype, 'addCue', vjs.TextTrack.prototype.addCue);
goog.exportProperty(vjs.TextTrack.prototype, 'removeCue', vjs.TextTrack.prototype.removeCue);
goog.exportProperty(vjs.TextTrackList.prototype, 'getTrackById', vjs.TextTrackList.prototype.getTrackById);
goog.exportProperty(vjs.TextTrackCueList.prototype, 'getCueById', vjs.TextTrackList.prototype.getCueById);

goog.exportSymbol('videojs.CaptionsTrack', vjs.CaptionsTrack);
goog.exportSymbol('videojs.SubtitlesTrack', vjs.SubtitlesTrack);
Expand Down