{"action":"created","issue":{"url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/536","labels_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/536/labels{/name}","comments_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/536/comments","events_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/536/events","html_url":"https://github.com/katspaugh/wavesurfer.js/issues/536","id":109797658,"number":536,"title":"(1.0.4) MediaElement - interaction reports getCurrentTime() of 0","user":{"login":"geeklisted","id":2224433,"avatar_url":"https://avatars.githubusercontent.com/u/2224433?v=3","gravatar_id":"","url":"https://api.github.com/users/geeklisted","html_url":"https://github.com/geeklisted","followers_url":"https://api.github.com/users/geeklisted/followers","following_url":"https://api.github.com/users/geeklisted/following{/other_user}","gists_url":"https://api.github.com/users/geeklisted/gists{/gist_id}","starred_url":"https://api.github.com/users/geeklisted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geeklisted/subscriptions","organizations_url":"https://api.github.com/users/geeklisted/orgs","repos_url":"https://api.github.com/users/geeklisted/repos","events_url":"https://api.github.com/users/geeklisted/events{/privacy}","received_events_url":"https://api.github.com/users/geeklisted/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-05T13:37:02Z","updated_at":"2015-10-05T14:34:50Z","closed_at":null,"body":"Using wavesurfer version 1.0.4.  I've encountered some cases where - even though WebAudio is supported - wavesurfer will not play a WAV file.  Specifically, this happens in Firefox 38.2 ESR.\r\n\r\nAs a result, I am attempting to use 'MediaElement' as the backend and its seems to work pretty well (minus more coarseness on when events are fired).\r\n\r\nUnfortunately, getCurrentTime() and setCurrentTime() do not appear to work correctly.\r\n\r\nWhen clicking within the audio clip buffer, the 'seek' event reports a getCurrentTime() of 0.\r\n\r\nWhen attempting to setCurrentTime() on the object, time always gets set to 0.\r\n\r\nStrangely, when 'audioprocess' event is fired, the getCurrentTime() value is correct.\r\n\r\nExample:\r\n\r\nwavesurfer.init({\r\n\t\t\t\t    container: document.getElementById(key + '_audio'),\r\n\t\t\t\t    backend: 'MediaElement',\r\n\t\t\t\t    waveColor: 'green',\r\n\t\t\t\t    progressColor: '#31C6CD',\r\n\t\t\t\t    cursorWidth: 2,\r\n\t\t\t\t    height: 52,\r\n\t\t\t\t    hideScrollbar: true,\r\n\t\t\t\t    scrollParent: false,\r\n\t\t\t\t    fillParent: true\r\n\t\t\t\t});\r\n\r\nwavesurfer.on('seek', function() {\r\n\t\t$log.info('seeking on key', key, 'at time', wavesurfer.getCurrentTime());\r\n// always reports 0\r\n});\r\n\r\n$scope.setTimeCode = function(_key, _playbackTime) {\r\n  \t\t\tif (_playbackTime) {\r\n\r\n  \t\t\t\t$scope.updateTimeCodes(_key, _playbackTime);\r\n\r\n  \t\t\t\tif ($scope.wavesurfers[_key]) {\r\n  \t\t\t\t\t//seekTo takes a progress %\r\n  \t\t\t\t\tvar progress = _playbackTime / $scope.wavesurfers[_key].getDuration();\r\n  \t\t\t\t\t$scope.wavesurfers[_key].seekTo( progress );\r\n // always goes to 0\r\n  \t\t\t\t}\r\n  \t\t\t}\r\n  \t\t};\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/comments/145547852","html_url":"https://github.com/katspaugh/wavesurfer.js/issues/536#issuecomment-145547852","issue_url":"https://api.github.com/repos/katspaugh/wavesurfer.js/issues/536","id":145547852,"user":{"login":"geeklisted","id":2224433,"avatar_url":"https://avatars.githubusercontent.com/u/2224433?v=3","gravatar_id":"","url":"https://api.github.com/users/geeklisted","html_url":"https://github.com/geeklisted","followers_url":"https://api.github.com/users/geeklisted/followers","following_url":"https://api.github.com/users/geeklisted/following{/other_user}","gists_url":"https://api.github.com/users/geeklisted/gists{/gist_id}","starred_url":"https://api.github.com/users/geeklisted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geeklisted/subscriptions","organizations_url":"https://api.github.com/users/geeklisted/orgs","repos_url":"https://api.github.com/users/geeklisted/repos","events_url":"https://api.github.com/users/geeklisted/events{/privacy}","received_events_url":"https://api.github.com/users/geeklisted/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T14:34:50Z","updated_at":"2015-10-05T14:34:50Z","body":"Thanks for response.  Might be difficult to get something together on codepen very quickly but I will try.\r\n\r\nI added a log on 'arguments' and it does appear to be receiving the proper progress value; however, wavesurfer.getCurrentTime() reports 0.\r\n\r\nWould upgrading to 1.0.42 make any difference?\r\n\r\nAgain, this issue does not occur when using WebAudio."}}