{"action":"opened","issue":{"url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/212","labels_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/212/comments","events_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/212/events","html_url":"https://github.com/videojs/videojs-contrib-hls/issues/212","id":57436666,"number":212,"title":"durationchange event does not fired ","user":{"login":"avreg","id":1052428,"avatar_url":"https://avatars.githubusercontent.com/u/1052428?v=3","gravatar_id":"","url":"https://api.github.com/users/avreg","html_url":"https://github.com/avreg","followers_url":"https://api.github.com/users/avreg/followers","following_url":"https://api.github.com/users/avreg/following{/other_user}","gists_url":"https://api.github.com/users/avreg/gists{/gist_id}","starred_url":"https://api.github.com/users/avreg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avreg/subscriptions","organizations_url":"https://api.github.com/users/avreg/orgs","repos_url":"https://api.github.com/users/avreg/repos","events_url":"https://api.github.com/users/avreg/events{/privacy}","received_events_url":"https://api.github.com/users/avreg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-12T09:34:38Z","updated_at":"2015-02-12T09:34:38Z","closed_at":null,"body":"HTML5.1 RFC\r\nload() stage: -> duration = NaN (without fired) (note videojs default 0, not a recommended NaN)\r\nfollowing_stage: if duration set to any_other_value => fire duration event\r\n\r\nFor testing, I modified standard example.html.\r\nResult and diff below.\r\n\r\n```\r\nduration after ready: 0\r\nloadedmetadata\r\nloadedmetadata\r\nloadeddata\r\ncanplay\r\nduration after canplay: 1801\r\n```\r\n\r\n```diff\r\ndiff --git a/example.html b/example.html\r\nindex b363f9e..dddfd82 100644\r\n--- a/example.html\r\n+++ b/example.html\r\n@@ -5,7 +5,7 @@\r\n   <title>video.js HLS Plugin Example</title>\r\n \r\n   <link href=\"node_modules/video.js/dist/video-js/video-js.css\" rel=\"stylesheet\">\r\n-  \r\n+\r\n   <!-- video.js -->\r\n   <script src=\"node_modules/video.js/dist/video-js/video.dev.js\"></script>\r\n \r\n@@ -71,7 +71,34 @@\r\n   <script>\r\n     videojs.options.flash.swf = 'node_modules/video.js/dist/video-js/video-js.swf';\r\n     // initialize the player\r\n-    var player = videojs('video');\r\n+    var events = [\r\n+       'canplay',\r\n+       'canplaythrough',\r\n+       'play',\r\n+       'playing',\r\n+       'pause',\r\n+       'ended',\r\n+       'error',\r\n+       'waiting',\r\n+       'seeking',\r\n+       'seeked',\r\n+       'loadstart',\r\n+       'loadeddata',\r\n+       'loadedmetadata',\r\n+       'durationchange',\r\n+       'emptied'\r\n+    ];\r\n+    var player = videojs('video', {}, function() {\r\n+       console.log('duration after ready: '  + this.duration());\r\n+       this.on(events, function(evt){\r\n+          console.log(evt.type);\r\n+       });\r\n+       this.one('canplay', function() {\r\n+          console.log('duration after canplay: '  + this.duration());\r\n+       });\r\n+    });\r\n```"}}