{"action":"created","issue":{"url":"https://api.github.com/repos/mbebenita/Broadway/issues/91","labels_url":"https://api.github.com/repos/mbebenita/Broadway/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/mbebenita/Broadway/issues/91/comments","events_url":"https://api.github.com/repos/mbebenita/Broadway/issues/91/events","html_url":"https://github.com/mbebenita/Broadway/issues/91","id":112639808,"number":91,"title":"play in reverse or seek to a frame?","user":{"login":"hapticdata","id":330356,"avatar_url":"https://avatars.githubusercontent.com/u/330356?v=3","gravatar_id":"","url":"https://api.github.com/users/hapticdata","html_url":"https://github.com/hapticdata","followers_url":"https://api.github.com/users/hapticdata/followers","following_url":"https://api.github.com/users/hapticdata/following{/other_user}","gists_url":"https://api.github.com/users/hapticdata/gists{/gist_id}","starred_url":"https://api.github.com/users/hapticdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hapticdata/subscriptions","organizations_url":"https://api.github.com/users/hapticdata/orgs","repos_url":"https://api.github.com/users/hapticdata/repos","events_url":"https://api.github.com/users/hapticdata/events{/privacy}","received_events_url":"https://api.github.com/users/hapticdata/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-21T17:29:01Z","updated_at":"2015-10-21T17:46:15Z","closed_at":null,"body":"Hello,\r\n\r\nI have the following function to render a frame, based off of the [MP4Player](https://github.com/mbebenita/Broadway/blob/master/Player/mp4.js#L758)\r\n\r\n```js\r\nfunction renderFrame(){\r\n        var video = this.reader.tracks[1];\r\n        var units = video.getSampleNALUnits(this.currentSample);\r\n\r\n        for( var i=0; i<units.length; i++){\r\n            var nal = units[i];\r\n            this.avc.decode(nal); // avc is a Player\r\n        }\r\n}\r\n```\r\n\r\nEverything works as expected when `currentSample` increases, but I would like to be able to play the video in reverse as well as jump to a specific frame. When `currentSample` decreases the video frags-up and is incoherent.\r\n\r\nHow can I go about playing the video in reverse? Or rendering a single frame?"},"comment":{"url":"https://api.github.com/repos/mbebenita/Broadway/issues/comments/149974681","html_url":"https://github.com/mbebenita/Broadway/issues/91#issuecomment-149974681","issue_url":"https://api.github.com/repos/mbebenita/Broadway/issues/91","id":149974681,"user":{"login":"soliton4","id":1090629,"avatar_url":"https://avatars.githubusercontent.com/u/1090629?v=3","gravatar_id":"","url":"https://api.github.com/users/soliton4","html_url":"https://github.com/soliton4","followers_url":"https://api.github.com/users/soliton4/followers","following_url":"https://api.github.com/users/soliton4/following{/other_user}","gists_url":"https://api.github.com/users/soliton4/gists{/gist_id}","starred_url":"https://api.github.com/users/soliton4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soliton4/subscriptions","organizations_url":"https://api.github.com/users/soliton4/orgs","repos_url":"https://api.github.com/users/soliton4/repos","events_url":"https://api.github.com/users/soliton4/events{/privacy}","received_events_url":"https://api.github.com/users/soliton4/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T17:46:15Z","updated_at":"2015-10-21T17:46:15Z","body":"a straight forward way would be to decode all frames and keep them in memory. but that could use a lot of memory.\r\n\r\nthe 5th byte of the nal unit gives you the type of nal. look for the closest iframe type before the position you are seeking. in theory you should be able to decode the 1st and 2nd nal unit of your stream and then continue with the iframe nal.\r\n"}}