1
0
mirror of https://github.com/videojs/video.js.git synced 2025-02-04 11:43:27 +02:00

Expand TOUCH_ENABLED and expose it publically

This commit is contained in:
Gary Katsevman 2013-10-09 15:32:01 -04:00
parent 61bc016637
commit c5a8cff129
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');