{"action":"created","comment":{"url":"https://api.github.com/repos/clappr/clappr/pulls/comments/37670414","id":37670414,"diff_hunk":"@@ -25,52 +25,62 @@ export default class SeekTime extends UIObject {\n   constructor(mediaControl) {\n     super()\n     this.mediaControl = mediaControl\n+    this.hoveringOverSeekBar = false\n+    this.hoverPosition = null\n     this.addEventListeners()\n   }\n \n   addEventListeners() {\n-    this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR, this.showTime)\n-    this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR, this.hideTime)\n-  }\n+    var self = this;\n+    this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR, function(event) {\n+      self.hoveringOverSeekBar = true\n+      self.calculateHoverPosition(event)\n+      self.update()\n+    })\n+    this.listenTo(this.mediaControl, Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR, function(event) {\n+      self.hoveringOverSeekBar = false\n+      self.update()\n+    })\n \n-  showTime(event) {\n-    if (!this.mediaControl.container.settings.seekEnabled) {\n-      return\n-    }\n+    // Not sure how to get a reference to the container. does this need to be a UICorePlugin like dvr_controls?\n+    // this.listenTo(this.mediaControl.container, Events.CONTAINER_SETTINGSUPDATE, this.update)\n+  }\n \n-    // the element must be unhidden before its width is requested, otherwise it's width will be reported as 0\n-    this.$el.removeClass('hidden')\n+  calculateHoverPosition(event) {\n     var offset = event.pageX - this.mediaControl.$seekBarContainer.offset().left\n-    if (offset >= 0 && offset <= this.mediaControl.$seekBarContainer.width()) {\n-      var timePosition = Math.min(100, Math.max((offset) / this.mediaControl.$seekBarContainer.width() * 100, 0))\n-      var pointerPosition = event.pageX - this.mediaControl.$el.offset().left\n-      pointerPosition = Math.min(Math.max(0, pointerPosition), this.mediaControl.$el.width() - this.$el.width() / 2)\n-      var currentTime = timePosition * this.mediaControl.container.getDuration() / 100\n-      var options = {\n-        timestamp: currentTime,\n-        formattedTime: formatTime(currentTime),\n-        pointerPosition: pointerPosition\n-      }\n-\n-      this.update(options)\n-    }\n+    // proportion into the seek bar that the mouse is hovered over 0-1\n+    this.hoverPosition = Math.min(1, Math.max(offset/this.mediaControl.$seekBarContainer.width(), 0))\n   }\n \n-  hideTime() {\n-    this.$el.addClass('hidden')\n-    this.$el.css('left', '-100%')\n+  update() {\n+    if (!this.shouldBeVisible()) {\n+      this.$el.addClass('hidden')\n+      this.$el.css('left', \"-100%\")\n+    }\n+    else {\n+      var currentTime = this.hoverPosition * this.mediaControl.container.getDuration()","path":"src/components/seek_time/seek_time.js","position":62,"original_position":62,"commit_id":"f2f79b2c2f0b1063b1829abf9b6da6d96c928f21","original_commit_id":"f2f79b2c2f0b1063b1829abf9b6da6d96c928f21","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long.","created_at":"2015-08-21T19:38:51Z","updated_at":"2015-08-21T19:38:51Z","html_url":"https://github.com/clappr/clappr/pull/528#discussion_r37670414","pull_request_url":"https://api.github.com/repos/clappr/clappr/pulls/528","_links":{"self":{"href":"https://api.github.com/repos/clappr/clappr/pulls/comments/37670414"},"html":{"href":"https://github.com/clappr/clappr/pull/528#discussion_r37670414"},"pull_request":{"href":"https://api.github.com/repos/clappr/clappr/pulls/528"}}},"pull_request":{"url":"https://api.github.com/repos/clappr/clappr/pulls/528","id":43072773,"html_url":"https://github.com/clappr/clappr/pull/528","diff_url":"https://github.com/clappr/clappr/pull/528.diff","patch_url":"https://github.com/clappr/clappr/pull/528.patch","issue_url":"https://api.github.com/repos/clappr/clappr/issues/528","number":528,"state":"open","locked":false,"title":"SeekTime Now Handles When \"seekEnabled\" setting changes","user":{"login":"tjenkinson","id":3259993,"avatar_url":"https://avatars.githubusercontent.com/u/3259993?v=3","gravatar_id":"","url":"https://api.github.com/users/tjenkinson","html_url":"https://github.com/tjenkinson","followers_url":"https://api.github.com/users/tjenkinson/followers","following_url":"https://api.github.com/users/tjenkinson/following{/other_user}","gists_url":"https://api.github.com/users/tjenkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tjenkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjenkinson/subscriptions","organizations_url":"https://api.github.com/users/tjenkinson/orgs","repos_url":"https://api.github.com/users/tjenkinson/repos","events_url":"https://api.github.com/users/tjenkinson/events{/privacy}","received_events_url":"https://api.github.com/users/tjenkinson/received_events","type":"User","site_admin":false},"body":"It doesn't yet but hopefully will by the end of this pull request!\r\n\r\nThis is what I have so far, it's basically the same as before just refactored slightly.\r\n\r\nI have some questions:\r\n1. How do I get access to the container to listen for the settings changed event? Does it need to be a UICorePlugin to get access to this?\r\n2. Where in the code does the duration value get added and updated? It feels like this should be something that is controlled here as well?\r\n \r\n![image](https://cloud.githubusercontent.com/assets/3259993/9417311/1ed0a60c-4843-11e5-90b4-b605c70f9bdc.png)\r\n\r\nThanks\r\n","created_at":"2015-08-21T19:31:10Z","updated_at":"2015-08-21T19:38:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e179fad66e4b0327a1f7d17ef3d464674de7bf85","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/clappr/clappr/pulls/528/commits","review_comments_url":"https://api.github.com/repos/clappr/clappr/pulls/528/comments","review_comment_url":"https://api.github.com/repos/clappr/clappr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clappr/clappr/issues/528/comments","statuses_url":"https://api.github.com/repos/clappr/clappr/statuses/f2f79b2c2f0b1063b1829abf9b6da6d96c928f21","head":{"label":"tjenkinson:seek-time-handle-settings-event","ref":"seek-time-handle-settings-event","sha":"f2f79b2c2f0b1063b1829abf9b6da6d96c928f21","user":{"login":"tjenkinson","id":3259993,"avatar_url":"https://avatars.githubusercontent.com/u/3259993?v=3","gravatar_id":"","url":"https://api.github.com/users/tjenkinson","html_url":"https://github.com/tjenkinson","followers_url":"https://api.github.com/users/tjenkinson/followers","following_url":"https://api.github.com/users/tjenkinson/following{/other_user}","gists_url":"https://api.github.com/users/tjenkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tjenkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjenkinson/subscriptions","organizations_url":"https://api.github.com/users/tjenkinson/orgs","repos_url":"https://api.github.com/users/tjenkinson/repos","events_url":"https://api.github.com/users/tjenkinson/events{/privacy}","received_events_url":"https://api.github.com/users/tjenkinson/received_events","type":"User","site_admin":false},"repo":{"id":35844737,"name":"clappr","full_name":"tjenkinson/clappr","owner":{"login":"tjenkinson","id":3259993,"avatar_url":"https://avatars.githubusercontent.com/u/3259993?v=3","gravatar_id":"","url":"https://api.github.com/users/tjenkinson","html_url":"https://github.com/tjenkinson","followers_url":"https://api.github.com/users/tjenkinson/followers","following_url":"https://api.github.com/users/tjenkinson/following{/other_user}","gists_url":"https://api.github.com/users/tjenkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tjenkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjenkinson/subscriptions","organizations_url":"https://api.github.com/users/tjenkinson/orgs","repos_url":"https://api.github.com/users/tjenkinson/repos","events_url":"https://api.github.com/users/tjenkinson/events{/privacy}","received_events_url":"https://api.github.com/users/tjenkinson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tjenkinson/clappr","description":"An extensible media player for the web","fork":true,"url":"https://api.github.com/repos/tjenkinson/clappr","forks_url":"https://api.github.com/repos/tjenkinson/clappr/forks","keys_url":"https://api.github.com/repos/tjenkinson/clappr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tjenkinson/clappr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tjenkinson/clappr/teams","hooks_url":"https://api.github.com/repos/tjenkinson/clappr/hooks","issue_events_url":"https://api.github.com/repos/tjenkinson/clappr/issues/events{/number}","events_url":"https://api.github.com/repos/tjenkinson/clappr/events","assignees_url":"https://api.github.com/repos/tjenkinson/clappr/assignees{/user}","branches_url":"https://api.github.com/repos/tjenkinson/clappr/branches{/branch}","tags_url":"https://api.github.com/repos/tjenkinson/clappr/tags","blobs_url":"https://api.github.com/repos/tjenkinson/clappr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tjenkinson/clappr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tjenkinson/clappr/git/refs{/sha}","trees_url":"https://api.github.com/repos/tjenkinson/clappr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tjenkinson/clappr/statuses/{sha}","languages_url":"https://api.github.com/repos/tjenkinson/clappr/languages","stargazers_url":"https://api.github.com/repos/tjenkinson/clappr/stargazers","contributors_url":"https://api.github.com/repos/tjenkinson/clappr/contributors","subscribers_url":"https://api.github.com/repos/tjenkinson/clappr/subscribers","subscription_url":"https://api.github.com/repos/tjenkinson/clappr/subscription","commits_url":"https://api.github.com/repos/tjenkinson/clappr/commits{/sha}","git_commits_url":"https://api.github.com/repos/tjenkinson/clappr/git/commits{/sha}","comments_url":"https://api.github.com/repos/tjenkinson/clappr/comments{/number}","issue_comment_url":"https://api.github.com/repos/tjenkinson/clappr/issues/comments{/number}","contents_url":"https://api.github.com/repos/tjenkinson/clappr/contents/{+path}","compare_url":"https://api.github.com/repos/tjenkinson/clappr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tjenkinson/clappr/merges","archive_url":"https://api.github.com/repos/tjenkinson/clappr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tjenkinson/clappr/downloads","issues_url":"https://api.github.com/repos/tjenkinson/clappr/issues{/number}","pulls_url":"https://api.github.com/repos/tjenkinson/clappr/pulls{/number}","milestones_url":"https://api.github.com/repos/tjenkinson/clappr/milestones{/number}","notifications_url":"https://api.github.com/repos/tjenkinson/clappr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tjenkinson/clappr/labels{/name}","releases_url":"https://api.github.com/repos/tjenkinson/clappr/releases{/id}","created_at":"2015-05-18T21:56:29Z","updated_at":"2015-05-18T21:56:31Z","pushed_at":"2015-08-21T19:38:42Z","git_url":"git://github.com/tjenkinson/clappr.git","ssh_url":"git@github.com:tjenkinson/clappr.git","clone_url":"https://github.com/tjenkinson/clappr.git","svn_url":"https://github.com/tjenkinson/clappr","homepage":"http://clappr.io","size":10340,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"clappr:master","ref":"master","sha":"48ab7a2602bbbfcc1fa3893bb11840afcc17eac7","user":{"login":"clappr","id":10685859,"avatar_url":"https://avatars.githubusercontent.com/u/10685859?v=3","gravatar_id":"","url":"https://api.github.com/users/clappr","html_url":"https://github.com/clappr","followers_url":"https://api.github.com/users/clappr/followers","following_url":"https://api.github.com/users/clappr/following{/other_user}","gists_url":"https://api.github.com/users/clappr/gists{/gist_id}","starred_url":"https://api.github.com/users/clappr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clappr/subscriptions","organizations_url":"https://api.github.com/users/clappr/orgs","repos_url":"https://api.github.com/users/clappr/repos","events_url":"https://api.github.com/users/clappr/events{/privacy}","received_events_url":"https://api.github.com/users/clappr/received_events","type":"Organization","site_admin":false},"repo":{"id":16844474,"name":"clappr","full_name":"clappr/clappr","owner":{"login":"clappr","id":10685859,"avatar_url":"https://avatars.githubusercontent.com/u/10685859?v=3","gravatar_id":"","url":"https://api.github.com/users/clappr","html_url":"https://github.com/clappr","followers_url":"https://api.github.com/users/clappr/followers","following_url":"https://api.github.com/users/clappr/following{/other_user}","gists_url":"https://api.github.com/users/clappr/gists{/gist_id}","starred_url":"https://api.github.com/users/clappr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clappr/subscriptions","organizations_url":"https://api.github.com/users/clappr/orgs","repos_url":"https://api.github.com/users/clappr/repos","events_url":"https://api.github.com/users/clappr/events{/privacy}","received_events_url":"https://api.github.com/users/clappr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clappr/clappr","description":"An extensible media player for the web","fork":false,"url":"https://api.github.com/repos/clappr/clappr","forks_url":"https://api.github.com/repos/clappr/clappr/forks","keys_url":"https://api.github.com/repos/clappr/clappr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clappr/clappr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clappr/clappr/teams","hooks_url":"https://api.github.com/repos/clappr/clappr/hooks","issue_events_url":"https://api.github.com/repos/clappr/clappr/issues/events{/number}","events_url":"https://api.github.com/repos/clappr/clappr/events","assignees_url":"https://api.github.com/repos/clappr/clappr/assignees{/user}","branches_url":"https://api.github.com/repos/clappr/clappr/branches{/branch}","tags_url":"https://api.github.com/repos/clappr/clappr/tags","blobs_url":"https://api.github.com/repos/clappr/clappr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clappr/clappr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clappr/clappr/git/refs{/sha}","trees_url":"https://api.github.com/repos/clappr/clappr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clappr/clappr/statuses/{sha}","languages_url":"https://api.github.com/repos/clappr/clappr/languages","stargazers_url":"https://api.github.com/repos/clappr/clappr/stargazers","contributors_url":"https://api.github.com/repos/clappr/clappr/contributors","subscribers_url":"https://api.github.com/repos/clappr/clappr/subscribers","subscription_url":"https://api.github.com/repos/clappr/clappr/subscription","commits_url":"https://api.github.com/repos/clappr/clappr/commits{/sha}","git_commits_url":"https://api.github.com/repos/clappr/clappr/git/commits{/sha}","comments_url":"https://api.github.com/repos/clappr/clappr/comments{/number}","issue_comment_url":"https://api.github.com/repos/clappr/clappr/issues/comments{/number}","contents_url":"https://api.github.com/repos/clappr/clappr/contents/{+path}","compare_url":"https://api.github.com/repos/clappr/clappr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clappr/clappr/merges","archive_url":"https://api.github.com/repos/clappr/clappr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clappr/clappr/downloads","issues_url":"https://api.github.com/repos/clappr/clappr/issues{/number}","pulls_url":"https://api.github.com/repos/clappr/clappr/pulls{/number}","milestones_url":"https://api.github.com/repos/clappr/clappr/milestones{/number}","notifications_url":"https://api.github.com/repos/clappr/clappr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clappr/clappr/labels{/name}","releases_url":"https://api.github.com/repos/clappr/clappr/releases{/id}","created_at":"2014-02-14T17:36:40Z","updated_at":"2015-08-21T06:57:15Z","pushed_at":"2015-08-21T19:38:42Z","git_url":"git://github.com/clappr/clappr.git","ssh_url":"git@github.com:clappr/clappr.git","clone_url":"https://github.com/clappr/clappr.git","svn_url":"https://github.com/clappr/clappr","homepage":"http://clappr.io","size":98681,"stargazers_count":2330,"watchers_count":2330,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":202,"mirror_url":null,"open_issues_count":35,"forks":202,"open_issues":35,"watchers":2330,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clappr/clappr/pulls/528"},"html":{"href":"https://github.com/clappr/clappr/pull/528"},"issue":{"href":"https://api.github.com/repos/clappr/clappr/issues/528"},"comments":{"href":"https://api.github.com/repos/clappr/clappr/issues/528/comments"},"review_comments":{"href":"https://api.github.com/repos/clappr/clappr/pulls/528/comments"},"review_comment":{"href":"https://api.github.com/repos/clappr/clappr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clappr/clappr/pulls/528/commits"},"statuses":{"href":"https://api.github.com/repos/clappr/clappr/statuses/f2f79b2c2f0b1063b1829abf9b6da6d96c928f21"}}}}