{"action":"opened","issue":{"url":"https://api.github.com/repos/processing/p5.js/issues/1019","labels_url":"https://api.github.com/repos/processing/p5.js/issues/1019/labels{/name}","comments_url":"https://api.github.com/repos/processing/p5.js/issues/1019/comments","events_url":"https://api.github.com/repos/processing/p5.js/issues/1019/events","html_url":"https://github.com/processing/p5.js/issues/1019","id":112369985,"number":1019,"title":"createVideo() optional callback when loaded as with createImg()","user":{"login":"shiffman","id":191758,"avatar_url":"https://avatars.githubusercontent.com/u/191758?v=3","gravatar_id":"","url":"https://api.github.com/users/shiffman","html_url":"https://github.com/shiffman","followers_url":"https://api.github.com/users/shiffman/followers","following_url":"https://api.github.com/users/shiffman/following{/other_user}","gists_url":"https://api.github.com/users/shiffman/gists{/gist_id}","starred_url":"https://api.github.com/users/shiffman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiffman/subscriptions","organizations_url":"https://api.github.com/users/shiffman/orgs","repos_url":"https://api.github.com/users/shiffman/repos","events_url":"https://api.github.com/users/shiffman/events{/privacy}","received_events_url":"https://api.github.com/users/shiffman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-20T13:33:54Z","updated_at":"2015-10-20T13:33:54Z","closed_at":null,"body":"I'm working on an example that maps a slider to the `duration()` of a video, however, this fails (as it should) since the video duration doesn't exist instantly:\r\n\r\n```javascript\r\nfunction setup() {\r\n  var mov = createVideo('file.mov');\r\n  var slider = createSlider(0, mov.duration(), mov.duration/2);\r\n}\r\n```\r\n\r\nI propose adding a callback for when the video is ready like we have with `createImg()`, i.e.\r\n\r\n```javascript\r\nvar mov;\r\n\r\nfunction setup() {\r\n  mov = createVideo('file.mov', ready);\r\n}\r\n\r\nfunction ready() {\r\n  var slider = createSlider(0, mov.duration(), mov.duration/2);\r\n}\r\n```"}}