{"action":"opened","issue":{"url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/908","labels_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/908/labels{/name}","comments_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/908/comments","events_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/908/events","html_url":"https://github.com/Dash-Industry-Forum/dash.js/issues/908","id":119386134,"number":908,"title":"How to add eventlistener in waiting&playing  to get duration of waiting event in 1.5.2 RC","user":{"login":"rofeifei","id":13682930,"avatar_url":"https://avatars.githubusercontent.com/u/13682930?v=3","gravatar_id":"","url":"https://api.github.com/users/rofeifei","html_url":"https://github.com/rofeifei","followers_url":"https://api.github.com/users/rofeifei/followers","following_url":"https://api.github.com/users/rofeifei/following{/other_user}","gists_url":"https://api.github.com/users/rofeifei/gists{/gist_id}","starred_url":"https://api.github.com/users/rofeifei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rofeifei/subscriptions","organizations_url":"https://api.github.com/users/rofeifei/orgs","repos_url":"https://api.github.com/users/rofeifei/repos","events_url":"https://api.github.com/users/rofeifei/events{/privacy}","received_events_url":"https://api.github.com/users/rofeifei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-29T20:35:37Z","updated_at":"2015-11-29T20:35:37Z","closed_at":null,"body":"Hi,\r\ni don't understand what code is needed to simply add eventlistner to waiting and playing event  to calculate the duration of waiting event \r\nbelow is a code proposed by @LloydW93, it tested but not working ? (see issue #865 )\r\n```javascript\r\nvar waitTime;\r\n\r\nfunction playHandler() {\r\n  console.log('Rebuffering for ' + (window.performance.now() - waitTime));\r\n  waitTime = NaN;\r\n  element.removeEventListener(playHandler);\r\n}\r\n\r\nelement.addEventListener('waiting', function() {\r\n  waitTime = window.performance.now();\r\n  element.addEventListener('playing', playHandler);\r\n});\r\n```\r\nthanks"}}