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

Tech 2.0 #2057

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6576e4e
Tech triggers on himself instead of the player
eXon Apr 22, 2015
ae25b8f
Dispose should already remove the event listeners
eXon Apr 22, 2015
34f90bb
Listen for tech error + save tech instance in the DOM for flash
eXon Apr 23, 2015
537907e
Added missing HTML5 events the player needs to listen and trigger bac…
eXon Apr 23, 2015
005aa9d
Player is responsible for adding the tech DOM element inside himself
eXon Apr 23, 2015
11bbb7b
Improved the check if the tech is in the DOM
Apr 23, 2015
19d19f8
Fix the HTML5 video reuse
eXon Apr 24, 2015
358880b
Removed player references in the Tech base class
eXon Apr 24, 2015
539c660
Enforce triple equals with jshint
Apr 24, 2015
d28137a
Listen for user activity by the player instead of the tech + some qui…
Apr 24, 2015
0147fc9
Refactor html5 tech to remove player references
Apr 25, 2015
779354c
Refactor flash tech to remove player references
eXon Apr 25, 2015
56d22ee
Removed player from tech tech signature
eXon Apr 25, 2015
1e47782
Only set controls on the tech if not using native
eXon Apr 25, 2015
6abec67
Merge with upstream
eXon Apr 28, 2015
54db3dd
Fixed a bunch of unit tests (not done yet)
eXon Apr 29, 2015
cbc0605
Merge with upstream
eXon Apr 29, 2015
6af5009
Fixed all unit tests
eXon Apr 30, 2015
f815c23
Merge with upstream
eXon Apr 30, 2015
6e803e5
Merge branch 'feature/tech-2.0' of https://github.com/eXon/video.js i…
heff May 1, 2015
693eab4
Merge pull request #1 from heff/eXon-feature/tech-2.0
eXon May 1, 2015
d699417
Fixed the setControls call when using native controls
eXon May 2, 2015
0b51928
Removed unused variable
eXon May 2, 2015
ccf0308
Removed firefox fix because it has been fixed in the browser
eXon May 2, 2015
a8062ed
Making sure textTracks_ is set before it can be touched
eXon May 2, 2015
5fa8eea
Merge with upstream
eXon May 5, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"undef" : true,
"laxbreak" : true,
"esnext" : true,
"eqeqeq" : true,
"predef" : [
"_V_",
"goog",
Expand Down
2 changes: 1 addition & 1 deletion src/js/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Button extends Component {
// KeyPress (document level) - Trigger click when keys are pressed
handleKeyPress(event) {
// Check for space bar (32) or enter (13) keys
if (event.which == 32 || event.which == 13) {
if (event.which === 32 || event.which === 13) {
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 be careful about changes like this that aren't directly related and touch a lot of files. We've got a hack week going on right now and master is going to change a lot, so there's going to be a lot of merge conflicts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea sorry about that. I should have left the eqeqeq option in jslint for another pull request. I'm trying to fix the unit tests ASAP so we could merge quickly.

event.preventDefault();
this.handleClick();
}
Expand Down
5 changes: 2 additions & 3 deletions src/js/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ class Component {
// If there was no ID from the options, generate one
if (!this.id_) {
// Don't require the player ID function in the case of mock players
let id = player.id && player.id() || 'no_player';

let id = player && player.id && player.id() || 'no_player';
this.id_ = `${id}_component_${Lib.guid++}`;
}

Expand Down Expand Up @@ -1033,7 +1032,7 @@ class Component {
*/
enableTouchActivity() {
// Don't continue if the root player doesn't support reporting user activity
if (!this.player().reportUserActivity) {
if (!this.player() || !this.player().reportUserActivity) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PlaybackRateMenuItem extends MenuItem {
}

update() {
this.selected(this.player().playbackRate() == this.rate);
this.selected(this.player().playbackRate() === this.rate);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/js/control-bar/progress-control/seek-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SeekBar extends Slider {
let newTime = this.calculateDistance(event) * this.player_.duration();

// Don't let video end while scrubbing.
if (newTime == this.player_.duration()) { newTime = newTime - 0.1; }
if (newTime === this.player_.duration()) { newTime = newTime - 0.1; }

// Set new time (tell player to seek to new time)
this.player_.currentTime(newTime);
Expand Down
2 changes: 1 addition & 1 deletion src/js/control-bar/text-track-controls/chapters-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ChaptersButton extends TextTrackButton {

for (let i = 0, l = tracks.length; i < l; i++) {
let track = tracks[i];
if (track['kind'] == this.kind_) {
if (track['kind'] === this.kind_) {
if (!track.cues) {
track['mode'] = 'hidden';
/* jshint loopfunc:true */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ class TextTrackButton extends MenuButton {
}

MenuButton.registerComponent('TextTrackButton', TextTrackButton);
export default TextTrackButton;
export default TextTrackButton;
Copy link
Member

Choose a reason for hiding this comment

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

Why's the export removed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops my bad, fixing this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh! I haven't removed the line, only the EOF empty line (stupid Atom doing that all the time :/). You can check it's still there.

Copy link
Member

Choose a reason for hiding this comment

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

Ok cool. Yeah I had to update my atom config to fix that recently.

2 changes: 1 addition & 1 deletion src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var videojs = function(id, options, ready){

// CDN Version. Used to target right flash swf.
videojs.CDN_VERSION = '__VERSION_NO_PATCH__';
videojs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://');
videojs.ACCESS_PROTOCOL = ('https:' === document.location.protocol ? 'https://' : 'http://');

/**
* Full player version
Expand Down
2 changes: 1 addition & 1 deletion src/js/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ var on = function(elem, type, fn){
};
}

if (data.handlers[type].length == 1) {
if (data.handlers[type].length === 1) {
if (elem.addEventListener) {
elem.addEventListener(type, data.dispatcher, false);
} else if (elem.attachEvent) {
Expand Down
6 changes: 3 additions & 3 deletions src/js/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var createEl = function(tagName='div', properties={}){
// add the attribute "role". My guess is because it's not a valid attribute in some namespaces, although
// browsers handle the attribute just fine. The W3C allows for aria-* attributes to be used in pre-HTML5 docs.
// http://www.w3.org/TR/wai-aria-primer/#ariahtml. Using setAttribute gets around this problem.
if (propName.indexOf('aria-') !== -1 || propName == 'role') {
if (propName.indexOf('aria-') !== -1 || propName === 'role') {
el.setAttribute(propName, val);
} else {
el[propName] = val;
Expand Down Expand Up @@ -616,10 +616,10 @@ var setLocalStorage = function(key, value){
if (!localStorage) { return; }
localStorage[key] = value;
} catch(e) {
if (e.code == 22 || e.code == 1014) { // Webkit == 22 / Firefox == 1014
if (e.code === 22 || e.code === 1014) { // Webkit == 22 / Firefox == 1014
log('LocalStorage Full (VideoJS)', e);
} else {
if (e.code == 18) {
if (e.code === 18) {
log('LocalStorage not allowed (VideoJS)', e);
} else {
log('LocalStorage Error (VideoJS)', e);
Expand Down
4 changes: 2 additions & 2 deletions src/js/menu/menu-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ class MenuButton extends Button {
handleKeyPress(event) {

// Check for space bar (32) or enter (13) keys
if (event.which == 32 || event.which == 13) {
if (event.which === 32 || event.which === 13) {
if (this.buttonPressed_){
this.unpressButton();
} else {
this.pressButton();
}
event.preventDefault();
// Check for escape (27) key
} else if (event.which == 27){
} else if (event.which === 27){
if (this.buttonPressed_){
this.unpressButton();
}
Expand Down
Loading