Skip to content

Commit

Permalink
Merge pull request videojs#774 from gkatsev/touch
Browse files Browse the repository at this point in the history
Expand TOUCH_ENABLED and expose it publically
  • Loading branch information
heff committed Oct 10, 2013
2 parents 61bc016 + e37e870 commit 1bef68a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/js/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ goog.exportSymbol('_V_', vjs);

goog.exportSymbol('videojs.options', vjs.options);
goog.exportSymbol('videojs.players', vjs.players);
goog.exportSymbol('videojs.TOUCH_ENABLED', vjs.TOUCH_ENABLED);

// Allow external components to use global cache
goog.exportSymbol('videojs.cache', vjs.cache);
Expand Down
2 changes: 1 addition & 1 deletion src/js/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ vjs.IS_OLD_ANDROID = vjs.IS_ANDROID && (/webkit/i).test(vjs.USER_AGENT) && vjs.A
vjs.IS_FIREFOX = (/Firefox/i).test(vjs.USER_AGENT);
vjs.IS_CHROME = (/Chrome/i).test(vjs.USER_AGENT);

vjs.TOUCH_ENABLED = ('ontouchstart' in window);
vjs.TOUCH_ENABLED = !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch);

/**
* Get an element's attribute values, as defined on the HTML tag
Expand Down
1 change: 1 addition & 0 deletions test/unit/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ test('should export ready api call to public', function() {
});

test('should export useful components to the public', function () {
ok(videojs.TOUCH_ENABLED, 'Touch detection should be public');
ok(videojs.ControlBar, 'ControlBar should be public');
ok(videojs.Button, 'Button should be public');
ok(videojs.PlayToggle, 'PlayToggle should be public');
Expand Down

0 comments on commit 1bef68a

Please # to comment.