{"action":"closed","issue":{"url":"https://api.github.com/repos/SunnyLi/videojs-ass/issues/15","repository_url":"https://api.github.com/repos/SunnyLi/videojs-ass","labels_url":"https://api.github.com/repos/SunnyLi/videojs-ass/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/SunnyLi/videojs-ass/issues/15/comments","events_url":"https://api.github.com/repos/SunnyLi/videojs-ass/issues/15/events","html_url":"https://github.com/SunnyLi/videojs-ass/issues/15","id":191741919,"number":15,"title":"Cannot toggle subtitle display on touch devices","user":{"login":"adgoncal","id":10856791,"avatar_url":"https://avatars.githubusercontent.com/u/10856791?v=3","gravatar_id":"","url":"https://api.github.com/users/adgoncal","html_url":"https://github.com/adgoncal","followers_url":"https://api.github.com/users/adgoncal/followers","following_url":"https://api.github.com/users/adgoncal/following{/other_user}","gists_url":"https://api.github.com/users/adgoncal/gists{/gist_id}","starred_url":"https://api.github.com/users/adgoncal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adgoncal/subscriptions","organizations_url":"https://api.github.com/users/adgoncal/orgs","repos_url":"https://api.github.com/users/adgoncal/repos","events_url":"https://api.github.com/users/adgoncal/events{/privacy}","received_events_url":"https://api.github.com/users/adgoncal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-25T17:04:00Z","updated_at":"2016-12-20T16:25:32Z","closed_at":"2016-12-20T16:25:32Z","body":"I am using videojs 5.12.6 and cannot toggle the subtitle display on touch devices. You can test it on Chrome's device emulation.\r\n\r\nYou are listening to click events, but other videojs buttons actually listen to tap, focus and blur in addition to click:\r\nhttps://github.com/videojs/video.js/blob/v5.12.6/src/js/clickable-component.js#L27\r\n\r\nAlso, other videojs buttons simply extend the Button Class with the `handleClick` and `buildCSSClass` methods instead of calling `this.on('click')` and `this.addClass` on the constructor.\r\nExample:\r\nhttps://github.com/videojs/video.js/blob/v5.12.6/src/js/control-bar/play-toggle.js#L39\r\nhttps://github.com/videojs/video.js/blob/v5.12.6/src/js/control-bar/play-toggle.js#L30\r\n\r\nSuggestion:\r\n```diff\r\n   constructor: function (player, options) {\r\n     options.name = options.name || 'assToggleButton';\r\n     VjsButton.call(this, player, options);\r\n-\r\n-    this.addClass('vjs-ass-button');\r\n-\r\n-    this.on('click', this.onClick);\r\n   },\r\n-  onClick: function () {\r\n+  buildCSSClass: function () {\r\n+    var classes = VjsButton.prototype.buildCSSClass.call(this);\r\n+    return 'vjs-ass-button ' + classes;\r\n+  },\r\n+  handleClick: function () {\r\n     if (!this.hasClass('inactive')) {\r\n       this.addClass('inactive');\r\n       overlay.style.display = \"none\";\r\n```"}}
{"actor":{"display_login":"SunnyLi"}}