1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-31 11:26:45 +02:00

Merge pull request #774 from gkatsev/touch

Expand TOUCH_ENABLED and expose it publically
This commit is contained in:
Steve Heffernan 2013-10-10 13:09:55 -07:00
commit 1bef68a60b
3 changed files with 3 additions and 1 deletions

View File

@ -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);

View File

@ -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

View File

@ -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');