{"issue":{"created_at":"2011-09-01T21:37:24Z","state":"closed","updated_at":"2011-11-21T14:12:17Z","comments":4,"user":{"gravatar_id":"b7b357241e1241a7326c97262a66e4e3","id":44993,"url":"https://api.github.com/users/danshort","login":"danshort","avatar_url":"https://secure.gravatar.com/avatar/b7b357241e1241a7326c97262a66e4e3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"I'm attempting to set the current time for a video before beginning playback, so that a user can click a set of links in order to move through a video. When doing this I get the following error:\r\n\r\n    INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.\r\n\r\nThe error is happening on this line in `media element-and-player.js`:\r\n\r\n     setCurrentTime: function (time) {\r\n        this.currentTime = time;\r\n    },\r\n\r\nI'm using the following code to start playback:\r\n\r\n\t$('ul.videoTOC li').each(function(){\r\n\t\t$(this).click(function(){\r\n\t\t\tplayer.setCurrentTime($(this).data('seconds'));\r\n\t\t\tplayer.play();\r\n\t\t});\r\n\t});\r\n\r\nIf I click one of the `li` elements before I have started playback of the video, I get the error. However, if I open the console and run `player.play()`, and then click one of the `li` elements everything works fine. So i tried this code next:\r\n\r\n\r\n\t$('ul.videoTOC li').each(function(){\r\n\t\t$(this).click(function(){\r\n\t\t\tplayer.play();\r\n\t\t\tplayer.setCurrentTime($(this).data('seconds'));\r\n\t\t\tplayer.play();\r\n\t\t});\r\n\t});\r\n\r\nThat gives me the exact same error. So something is happening when trying to set the current time before *enough* has played back. I get the error in both Safari and Chrome. I get no error, but no jump in the time either, on Firefox.\r\n\r\nOnce again, once playback has begun, the code works perfect. But attempting to setCurrentTime before playback has successfully begun results in an error.","assignee":null,"id":1546318,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":243,"labels":[],"title":"INVALID_STATE_ERR when calling setCurrentTime() before play()","closed_at":"2011-11-21T14:12:17Z","html_url":"https://github.com/johndyer/mediaelement/issues/243","url":"https://api.github.com/repos/johndyer/mediaelement/issues/243","milestone":null},"action":"closed"}